-
Notifications
You must be signed in to change notification settings - Fork 6
Why is the version of my Kera 2.24 wrong? #1
Description
import pydot
from keras.utils.vis_utils import plot_model
model_vqa = get_VQA_model(VQA_model_file_name, VQA_weights_file_name)
plot_model(model_vqa, to_file='images/model_vqa.png')
ValueError Traceback (most recent call last)
in ()
2 from keras.utils.vis_utils import plot_model
3
----> 4 model_vqa = get_VQA_model(VQA_model_file_name, VQA_weights_file_name)
5
6 plot_model(model_vqa, to_file='images/model_vqa.png')
in get_VQA_model(VQA_model_file_name, VQA_weights_file_name)
1 def get_VQA_model(VQA_model_file_name, VQA_weights_file_name):
2
----> 3 vqa_model = model_from_json(open(VQA_model_file_name).read())
4 vqa_model.load_weights(VQA_weights_file_name)
5 vqa_model.compile(loss='categorical_crossentropy', optimizer='rmsprop')
/usr/local/lib/python3.6/dist-packages/keras/engine/saving.py in model_from_json(json_string, custom_objects)
490 config = json.loads(json_string)
491 from ..layers import deserialize
--> 492 return deserialize(config, custom_objects=custom_objects)
493
494
/usr/local/lib/python3.6/dist-packages/keras/layers/init.py in deserialize(config, custom_objects)
53 module_objects=globs,
54 custom_objects=custom_objects,
---> 55 printable_module_name='layer')
/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
143 config['config'],
144 custom_objects=dict(list(_GLOBAL_CUSTOM_OBJECTS.items()) +
--> 145 list(custom_objects.items())))
146 with CustomObjectScope(custom_objects):
147 return cls.from_config(config['config'])
/usr/local/lib/python3.6/dist-packages/keras/engine/sequential.py in from_config(cls, config, custom_objects)
298 for conf in layer_configs:
299 layer = layer_module.deserialize(conf,
--> 300 custom_objects=custom_objects)
301 model.add(layer)
302 if not model.inputs and build_input_shape:
/usr/local/lib/python3.6/dist-packages/keras/layers/init.py in deserialize(config, custom_objects)
53 module_objects=globs,
54 custom_objects=custom_objects,
---> 55 printable_module_name='layer')
/usr/local/lib/python3.6/dist-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
136 if cls is None:
137 raise ValueError('Unknown ' + printable_module_name +
--> 138 ': ' + class_name)
139 if hasattr(cls, 'from_config'):
140 custom_objects = custom_objects or {}