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

Loading pretrained model and using predict.py on it #23

Open
deepankarpal89 opened this issue Dec 6, 2017 · 3 comments
Open

Loading pretrained model and using predict.py on it #23

deepankarpal89 opened this issue Dec 6, 2017 · 3 comments

Comments

@deepankarpal89
Copy link

I tried to load the pretrained model you have provided and using it to predict on the dev set. I get the following error while loading the model by using keras load_model(model_path). Following is the error

Traceback (most recent call last):
File "predict.py", line 35, in
model = load_model(args.model, custom_objects())
File "/Users/deepankar/anaconda3/envs/squad/lib/python2.7/site-packages/keras/models.py", line 240, in load_model
model = model_from_config(model_config, custom_objects=custom_objects)
File "/Users/deepankar/anaconda3/envs/squad/lib/python2.7/site-packages/keras/models.py", line 314, in model_from_config
return layer_module.deserialize(config, custom_objects=custom_objects)
File "/Users/deepankar/anaconda3/envs/squad/lib/python2.7/site-packages/keras/layers/init.py", line 55, in deserialize
printable_module_name='layer')
File "/Users/deepankar/anaconda3/envs/squad/lib/python2.7/site-packages/keras/utils/generic_utils.py", line 140, in deserialize_keras_object
list(custom_objects.items())))
File "/Users/deepankar/anaconda3/envs/squad/lib/python2.7/site-packages/keras/engine/topology.py", line 2500, in from_config
process_node(layer, node_data)
File "/Users/deepankar/anaconda3/envs/squad/lib/python2.7/site-packages/keras/engine/topology.py", line 2459, in process_node
layer(input_tensors, **kwargs)
File "/Users/deepankar/anaconda3/envs/squad/lib/python2.7/site-packages/keras/layers/recurrent.py", line 514, in call
full_input_spec = self.input_spec + additional_specs
TypeError: unsupported operand type(s) for +: 'NoneType' and 'list'

@mahnerak
Copy link
Member

Sorry for late response,
What Keras version do you use?

@ujjax
Copy link

ujjax commented Mar 22, 2018

Which Keras version did you use @mahnerak ??

@Steven-AA
Copy link

Same problem
I am using keras 2.1.5 to use multi gpu model

btw, training is really slow
it takes about 5 hours for each epoch on one 1080ti with 150 batch_size

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

4 participants