Qidian213 / deep_sort_yolov3

Real-time Multi-person tracker using YOLO v3 and deep_sort with tensorflow
GNU General Public License v3.0
1.66k stars 595 forks source link

Not working for custom keras model #157

Closed vihari1729 closed 3 years ago

vihari1729 commented 4 years ago

@Qidian213 I have trained my dataset using this git hub repository https://github.com/AntonMu/TrainYourOwnYOLO and obtained keras model for my classes. also getting results while testing images and videos input. To Implement Tracking, while running yolo.py from this repository I changed the paths of both classes and model to my trained files and what objects to track in demo.py and I am getting error like this:

Traceback (most recent call last):
  File "demo.py", line 131, in <module>
    main(YOLO())
  File "/home/unizen/deep_sort_yolov3/yolo.py", line 33, in __init__
    self.boxes, self.scores, self.classes = self.generate()
  File "/home/unizen/deep_sort_yolov3/yolo.py", line 54, in generate
    self.yolo_model = load_model(model_path, compile=False)
  File "/home/unizen/anaconda3/lib/python3.7/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "/home/unizen/anaconda3/lib/python3.7/site-packages/keras/engine/saving.py", line 221, in _deserialize_model
    model_config = f['model_config']
  File "/home/unizen/anaconda3/lib/python3.7/site-packages/keras/utils/io_utils.py", line 302, in __getitem__
    raise ValueError('Cannot create group in read only mode.')
ValueError: Cannot create group in read only mode.

I think some code should be changed regarding the input size and yolo_anchors.txt in the yolo.py.

Kindly help me regarding this