hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.23k stars 1.24k forks source link

ValueError: Unable to create group (name already exists) #344

Open DanMS98 opened 3 years ago

DanMS98 commented 3 years ago

Hi I'm trying to convert darknet Yolov4-tiny weights to tensorflow weights by running save-model.py script. but I'm facing the following error:

Traceback (most recent call last):
  File "save_model.py", line 58, in <module>
    app.run(main)
  File "/home/danial/.local/lib/python3.6/site-packages/absl/app.py", line 300, in run
    _run_main(main, args)
  File "/home/danial/.local/lib/python3.6/site-packages/absl/app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "save_model.py", line 54, in main
    save_tf()
  File "save_model.py", line 51, in save_tf
    model.save(FLAGS.output)
  File "/home/danial/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/engine/network.py", line 1171, in save
    signatures)
  File "/home/danial/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/save.py", line 109, in save_model
    model, filepath, overwrite, include_optimizer)
  File "/home/danial/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 103, in save_model_to_hdf5
    save_weights_to_hdf5_group(model_weights_group, model_layers)
  File "/home/danial/.local/lib/python3.6/site-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 619, in save_weights_to_hdf5_group
    g = f.create_group(layer.name)
  File "/home/danial/.local/lib/python3.6/site-packages/h5py/_hl/group.py", line 68, in create_group
    gid = h5g.create(self.id, name, lcpl=lcpl, gcpl=gcpl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5g.pyx", line 161, in h5py.h5g.create
ValueError: Unable to create group (name already exists)

any idea what's causing this and how to fix it?

asmaamirkhan commented 3 years ago

Using tensorflow 2 solved the problem 🎉