Greetings!!
I downloaded the Face Recognition programming assignment files so I can work on it on my laptop. When I run the cells, I get the following error. Tensorflow version 2.9.1 is installed on my computer.
What other packages do I need to install to get this notebook working on my machine? Please let me know. Thank you!
ValueError Traceback (most recent call last)
/tmp/ipykernel_42061/324912946.py in
4 loaded_model_json = json_file.read()
5 json_file.close()
----> 6 model = model_from_json(loaded_model_json)
7 model.load_weights(‘keras-facenet-h5/model.h5’)
~/anaconda3/lib/python3.9/site-packages/keras/saving/model_config.py in model_from_json(json_string, custom_objects)
100 “”"
101 from keras.layers import deserialize_from_json # pylint: disable=g-import-not-at-top
→ 102 return deserialize_from_json(json_string, custom_objects=custom_objects)
~/anaconda3/lib/python3.9/site-packages/keras/layers/serialization.py in deserialize_from_json(json_string, custom_objects)
224 module_objects=LOCAL.ALL_OBJECTS,
225 custom_objects=custom_objects)
→ 226 return deserialize(config, custom_objects)
~/anaconda3/lib/python3.9/site-packages/keras/layers/serialization.py in deserialize(config, custom_objects)
203 “”"
204 populate_deserializable_objects()
→ 205 return generic_utils.deserialize_keras_object(
206 config,
207 module_objects=LOCAL.ALL_OBJECTS,
~/anaconda3/lib/python3.9/site-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
677
678 if ‘custom_objects’ in arg_spec.args:
→ 679 deserialized_obj = cls.from_config(
680 cls_config,
681 custom_objects=dict(
~/anaconda3/lib/python3.9/site-packages/keras/engine/training.py in from_config(cls, config, custom_objects)
2718 ]
2719 if all(key in config for key in functional_model_keys):
→ 2720 inputs, outputs, layers = functional.reconstruct_from_config(
2721 config, custom_objects)
2722 model = cls(inputs=inputs, outputs=outputs, name=config.get(‘name’))
~/anaconda3/lib/python3.9/site-packages/keras/engine/functional.py in reconstruct_from_config(config, custom_objects, created_layers)
1298 # First, we create all layers and enqueue nodes to be processed
1299 for layer_data in config[‘layers’]:
→ 1300 process_layer(layer_data)
1301 # Then we process nodes in order of layer depth.
1302 # Nodes that cannot yet be processed (if the inbound node
~/anaconda3/lib/python3.9/site-packages/keras/engine/functional.py in process_layer(layer_data)
1280 from keras.layers import deserialize as deserialize_layer # pylint: disable=g-import-not-at-top
1281
→ 1282 layer = deserialize_layer(layer_data, custom_objects=custom_objects)
1283 created_layers[layer_name] = layer
1284
~/anaconda3/lib/python3.9/site-packages/keras/layers/serialization.py in deserialize(config, custom_objects)
203 “”"
204 populate_deserializable_objects()
→ 205 return generic_utils.deserialize_keras_object(
206 config,
207 module_objects=LOCAL.ALL_OBJECTS,
~/anaconda3/lib/python3.9/site-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
677
678 if ‘custom_objects’ in arg_spec.args:
→ 679 deserialized_obj = cls.from_config(
680 cls_config,
681 custom_objects=dict(
~/anaconda3/lib/python3.9/site-packages/keras/layers/core/lambda_layer.py in from_config(cls, config, custom_objects)
301 def from_config(cls, config, custom_objects=None):
302 config = config.copy()
→ 303 function = cls._parse_function_from_config(config, custom_objects,
304 ‘function’, ‘module’,
305 ‘function_type’)
~/anaconda3/lib/python3.9/site-packages/keras/layers/core/lambda_layer.py in _parse_function_from_config(cls, config, custom_objects, func_attr_name, module_attr_name, func_type_attr_name)
356 elif function_type == ‘lambda’:
357 # Unsafe deserialization from bytecode
→ 358 function = generic_utils.func_load(config[func_attr_name], globs=globs)
359 elif function_type == ‘raw’:
360 function = config[func_attr_name]
~/anaconda3/lib/python3.9/site-packages/keras/utils/generic_utils.py in func_load(code, defaults, closure, globs)
791 except (UnicodeEncodeError, binascii.Error):
792 raw_code = code.encode(‘raw_unicode_escape’)
→ 793 code = marshal.loads(raw_code)
794 if globs is None:
795 globs = globals()
ValueError: bad marshal data (unknown type code)