Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run eval.py via the provided json pre-trained model. #76

Open
ganeshjha opened this issue Oct 25, 2021 · 0 comments
Open

Unable to run eval.py via the provided json pre-trained model. #76

ganeshjha opened this issue Oct 25, 2021 · 0 comments

Comments

@ganeshjha
Copy link

Faced many challenges related to the tf and keras compatible version. After a lot of hassles, I was able to resolve the dependencies of libraries needed. Now, I am stuck at the below issue where it is asking for some marshal code. I believe this is coming from the custom objects passed into the model_from_json api call in eval.py line 140.
Please advise or let me know if there is any updated stable version of the codebase.

Using TensorFlow backend.
find: -xtype: unknown primary or operator
make: `adaptor.so' is up to date.
WARNING:tensorflow:From /Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:349: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3147: The name tf.random_uniform is deprecated. Please use tf.random.uniform instead.

WARNING:tensorflow:From /Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:99: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING:tensorflow:From /Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:3014: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

Traceback (most recent call last):
File "eval.py", line 194, in
main()
File "eval.py", line 140, in main
model = model_from_json(loaded_model_json)#, custom_objects={'tf': tf})#, 'RESIZE_FACTOR': RESIZE_FACTOR})
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/models.py", line 325, in model_from_json
return layer_module.deserialize(config, custom_objects=custom_objects)
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/layers/init.py", line 46, in deserialize
printable_module_name='layer')
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object
list(custom_objects.items())))
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/engine/topology.py", line 2361, in from_config
process_layer(layer_data)
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/engine/topology.py", line 2330, in process_layer
custom_objects=custom_objects)
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/layers/init.py", line 46, in deserialize
printable_module_name='layer')
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object
list(custom_objects.items())))
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/layers/core.py", line 706, in from_config
function = func_load(config['function'], globs=globs)
File "/Users/ganjha/opt/anaconda3/envs/eastv1/lib/python3.7/site-packages/keras/utils/generic_utils.py", line 200, in func_load
code = marshal.loads(code.encode('raw_unicode_escape'))
ValueError: bad marshal data (unknown type code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant