keras-facenet icon indicating copy to clipboard operation
keras-facenet copied to clipboard

Error in demo-images notebook

Open jykim opened this issue 5 years ago • 1 comments

Getting the following error while loading the model (on tensorflow-gpu (1.13.1))

Any guess?

model_path = '../model/keras/model/facenet_keras.h5' model = load_model(model_path)


WARNING:tensorflow:From /usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version. Instructions for updating: Colocations handled automatically by placer.

IndexError Traceback (most recent call last) in 1 model_path = '../model/keras/model/facenet_keras.h5' ----> 2 model = load_model(model_path)

/usr/local/lib/python3.5/dist-packages/keras/engine/saving.py in load_model(filepath, custom_objects, compile) 417 f = h5dict(filepath, 'r') 418 try: --> 419 model = _deserialize_model(f, custom_objects, compile) 420 finally: 421 if opened_new_file:

/usr/local/lib/python3.5/dist-packages/keras/engine/saving.py in _deserialize_model(f, custom_objects, compile) 223 raise ValueError('No model found in config.') 224 model_config = json.loads(model_config.decode('utf-8')) --> 225 model = model_from_config(model_config, custom_objects=custom_objects) 226 model_weights_group = f['model_weights'] 227

/usr/local/lib/python3.5/dist-packages/keras/engine/saving.py in model_from_config(config, custom_objects) 456 'Sequential.from_config(config)?') 457 from ..layers import deserialize --> 458 return deserialize(config, custom_objects=custom_objects) 459 460

/usr/local/lib/python3.5/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.5/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.5/dist-packages/keras/engine/network.py in from_config(cls, config, custom_objects) 1030 if layer in unprocessed_nodes: 1031 for node_data in unprocessed_nodes.pop(layer): -> 1032 process_node(layer, node_data) 1033 1034 name = config.get('name')

/usr/local/lib/python3.5/dist-packages/keras/engine/network.py in process_node(layer, node_data) 989 # and building the layer if needed. 990 if input_tensors: --> 991 layer(unpack_singleton(input_tensors), **kwargs) 992 993 def process_layer(layer_data):

/usr/local/lib/python3.5/dist-packages/keras/engine/base_layer.py in call(self, inputs, **kwargs) 455 # Actually call the layer, 456 # collecting output(s), mask(s), and shape(s). --> 457 output = self.call(inputs, **kwargs) 458 output_mask = self.compute_mask(inputs, previous_mask) 459

/usr/local/lib/python3.5/dist-packages/keras/layers/core.py in call(self, inputs, mask) 685 if has_arg(self.function, 'mask'): 686 arguments['mask'] = mask --> 687 return self.function(inputs, **arguments) 688 689 def compute_mask(self, inputs, mask=None):

/usr/local/lib/python3.5/dist-packages/keras/layers/core.py in (inputs, scale) 88 rate: float between 0 and 1. Fraction of the input units to drop. 89 noise_shape: 1D integer tensor representing the shape of the ---> 90 binary dropout mask that will be multiplied with the input. 91 For instance, if your inputs have shape 92 (batch_size, timesteps, features) and

IndexError: tuple index out of range

jykim avatar Apr 14 '19 07:04 jykim

check this

I think you need the use the same version of python as the model is created.

caiya55 avatar Sep 27 '19 13:09 caiya55