tornado.application - ERROR - Exception in callback functools.partial(<bound method IOLoop._discard_future_result of <tornado.platform.asyncio.AsyncIOLoop object at 0x7fec8a50ca90>>, <Task finished name='Task-5' coro=<Worker.handle_scheduler() done, defined at /Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/distributed/worker.py:988> exception=TypeError('Could not serialize object of type tuple.\nTraceback (most recent call last):\n

 "/Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/distributed/protocol/pickle.py", line 49, in dumps\n
result = pickle.dumps(x, **dump_kwargs)\nAttributeError: Can\'t pickle local object \'foo_does_not_works.<locals>.bar\'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n


"/Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/distributed/protocol/serialize.py", line 307, in serialize\n
header, frames = dumps(x, context=context) if wants_context else dumps(x)\n

 "/Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/distributed/protocol/serialize.py", line 58, in pickle_dumps\n
frames[0] = pickle.dumps(\n

 "/Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/distributed/protocol/pickle.py", line 60, in dumps\n
result = cloudpickle.dumps(x, **dump_kwargs)\n

 "/Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/cloudpickle/cloudpickle_fast.py", line 73, in dumps\n
cp.dump(obj)\n

 "/Users/aktech/anaconda3/envs/distributed-bug/lib/python3.8/site-packages/cloudpickle/cloudpickle_fast.py"

Traceback (most recent call last):


 "D:/pythonwork/Adversarial/Cifar10_keras_Adversarial/MisClassification.py", line 100, in <module>

main()


 "D:/pythonwork/Adversarial/Cifar10_keras_Adversarial/MisClassification.py", line 21, in main

kmodel = load_model(weight_path)


 "D:\Users\Python\lib\site-packages\keras\engine\saving.py", line 261, in load_model

model = model_from_config(model_config, custom_objects=custom_objects)


 "D:\Users\Python\lib\site-packages\keras\engine\saving.py", line 335, in model_from_config

return deserialize(config, custom_objects=custom_objects)


 "D:\Users\Python\lib\site-packages\keras\layers\__init__.py", line 55, in deserialize

printable_module_name='layer')


 "D:\Users\Python\lib\site-packages\keras\utils\generic_utils.py", line 145, in deserialize_keras_object

list(custom_objects.items())))


 "D:\Users\Python\lib\site-packages\keras\engine\sequential.py", line 292, in from_config

custom_objects=custom_objects)


 "D:\Users\Python\lib\site-packages\keras\layers\__init__.py", line 55, in deserialize

printable_module_name='layer')


 "D:\Users\Python\lib\site-packages\keras\utils\generic_utils.py", line 165, in deserialize_keras_object

':' + function_name)
ValueError: Unknown layer:layers