allanzelener / YAD2K

YAD2K: Yet Another Darknet 2 Keras
Other
2.71k stars 879 forks source link

Trying to run test_yolo.py on result of retraining w/ retrain_yolo.py #168

Closed cschar closed 5 years ago

cschar commented 5 years ago

python ./test_yolo.py ./trained_stage_3.h5 --classes_path ./datasets/set1/classes.txt

Error is as follows:

   yolo_model = load_model(model_path)
  File "C:\Users\codywin\AppData\Local\conda\conda\envs\tf-gpu-1.13\lib\site-packages\
keras\engine\saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "C:\Users\codywin\AppData\Local\conda\conda\envs\tf-gpu-1.13\lib\site-packages\
keras\engine\saving.py", line 221, in _deserialize_model
    model_config = f['model_config']
  File "C:\Users\codywin\AppData\Local\conda\conda\envs\tf-gpu-1.13\lib\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.
(tf-gpu-1.13)

It can successfully train the model in retrain_yolo.py, and then draw boxes, but can't load up using the test_yolo.py command.

As of now i'm going to just hack retrain_yolo.py into another file to test with, but I would have liked to use the test_yolo.py directly.

alexfaus08 commented 5 years ago

I'm having the same issue

alexfaus08 commented 5 years ago

@cschar retrain_yolo.py only generates a weights file. You then have to run yad2k.py with that weights file and it will generate a model that will work for test_yolo.py

cschar commented 5 years ago

Ah thanks @alexfaus08 !