Bad marshal data YoLo model

I tried to run a project from repo and got the following log which, I believe, tells a problem with weights load.

python3 main.py
Traceback (most recent call last):
File main.py, line 66, in module
yolo = YOLO()
File /home/matalan/venv/survalance/Traffic-Survalance/ObjectDetection.py, line 32, in __init__
self.model = self._get_model()
File /home/matalan/venv/survalance/Traffic-Survalance/ObjectDetection.py, line 39, in _get_model
return load_model(self.model_path)
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/saving/save.py, line 182, in load_model
  return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/saving/hdf5_format.py, line 177, in load_model_from_hdf5
  model = model_config_lib.model_from_config(model_config,
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/saving/model_config.py, line 55, in model_from_config
  return deserialize(config, custom_objects=custom_objects)
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/layers/serialization.py, line 171, in deserialize
  return generic_utils.deserialize_keras_object(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/utils/generic_utils.py, line 354, in 
  deserialize_keras_object
return cls.from_config(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/engine/training.py, line 2238, in from_config
return functional.Functional.from_config(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/engine/functional.py, line 616, in from_config
  input_tensors, output_tensors, created_layers = reconstruct_from_config(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/engine/functional.py, line 1204, in 
  reconstruct_from_config
 process_layer(layer_data)
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/engine/functional.py, line 1186, in process_layer
layer = deserialize_layer(layer_data, custom_objects=custom_objects)
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/layers/serialization.py, line 171, in deserialize
return generic_utils.deserialize_keras_object(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/utils/generic_utils.py, line 354, in 
  deserialize_keras_object
return cls.from_config(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/layers/core.py, line 1005, in from_config
function = cls._parse_function_from_config(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/layers/core.py, line 1057, in 
  _parse_function_from_config
function = generic_utils.func_load(
File /home/matalan/.local/lib/python3.8/site- 
  packages/tensorflow/python/keras/utils/generic_utils.py, line 457, in func_load
code = marshal.loads(raw_code)
ValueError: bad marshal data (unknown type code)

I use python 3.8.5 and latests TF Keras for cpu. Is there a way to fix it? (load other weights or smth)

Topic weight-initialization yolo keras tensorflow

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.