You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to load the pre-trained Keras models using Tensorflow 2.1.0 (Python 3.6.9). I am getting the following err (I also tried tf 1.14 and tf 2.0, same result):
Traceback (most recent call last):
File "test_bagnet.py", line 40, in
model = bagnet17()
File "test_bagnet.py", line 28, in bagnet17
return load_model(model_path)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/save.py", line 146, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 168, in load_model_from_hdf5
custom_objects=custom_objects)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/model_config.py", line 55, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/layers/serialization.py", line 106, in deserialize
printable_module_name='layer')
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/utils/generic_utils.py", line 303, in deserialize_keras_object
list(custom_objects.items())))
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 937, in from_config
config, custom_objects)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1903, in reconstruct_from_config
process_node(layer, node_data)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1851, in process_node
output_tensors = layer(input_tensors, **kwargs)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 748, in call
self._maybe_build(inputs)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 2116, in _maybe_build
self.build(input_shapes)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/layers/core.py", line 1101, in build
raise ValueError('The last dimension of the inputs to Dense '
ValueError: The last dimension of the inputs to Dense should be defined. Found None.
Is there a workaround? In issue #19 you mentioned loading the models in tensorflow successfully, which version did you use?
The text was updated successfully, but these errors were encountered:
I am trying to load the pre-trained Keras models using Tensorflow 2.1.0 (Python 3.6.9). I am getting the following err (I also tried tf 1.14 and tf 2.0, same result):
Traceback (most recent call last):
File "test_bagnet.py", line 40, in
model = bagnet17()
File "test_bagnet.py", line 28, in bagnet17
return load_model(model_path)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/save.py", line 146, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 168, in load_model_from_hdf5
custom_objects=custom_objects)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/model_config.py", line 55, in model_from_config
return deserialize(config, custom_objects=custom_objects)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/layers/serialization.py", line 106, in deserialize
printable_module_name='layer')
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/utils/generic_utils.py", line 303, in deserialize_keras_object
list(custom_objects.items())))
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 937, in from_config
config, custom_objects)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1903, in reconstruct_from_config
process_node(layer, node_data)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1851, in process_node
output_tensors = layer(input_tensors, **kwargs)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 748, in call
self._maybe_build(inputs)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 2116, in _maybe_build
self.build(input_shapes)
File "/home/hmueller/venv3/lib/python3.6/site-packages/tensorflow_core/python/keras/layers/core.py", line 1101, in build
raise ValueError('The last dimension of the inputs to
Dense
'ValueError: The last dimension of the inputs to
Dense
should be defined. FoundNone
.Is there a workaround? In issue #19 you mentioned loading the models in tensorflow successfully, which version did you use?
The text was updated successfully, but these errors were encountered: