我的操作系统是 Ubuntu。
当我运行我的 keras 模型时,我收到了这个错误消息。
我在谷歌上搜索了一些解决方案,但它们不起作用。例如,我已经尝试了这篇文章中提到的解决方案: How to fix Python ValueError:bad marshal data?
Using TensorFlow backend.
[INFO] loading network...
Traceback (most recent call last):
File "classify.py", line 43, in <module>
color_model = load_model(color_model_path, custom_objects={"tf": tf})
File "/home/ubuntufashion/.local/lib/python2.7/site-
packages/keras/engine/saving.py", line 260, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/home/ubuntufashion/.local/lib/python2.7/site-
packages/keras/engine/saving.py", line 334, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "/home/ubuntufashion/.local/lib/python2.7/site-
packages/keras/layers/__init__.py", line 55, in deserialize
printable_module_name='layer')
File "/home/ubuntufashion/.local/lib/python2.7/site-
packages/keras/utils/generic_utils.py", line 145, in
deserialize_keras_object
list(custom_objects.items())))
File "/home/ubuntufashion/.local/lib/python2.7/site-
packages/keras/engine/network.py", line 1017, in from_config
process_layer(layer_data) …Run Code Online (Sandbox Code Playgroud)