allanzelener / YAD2K

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

train_yolo.py model loading problem #113

Open LaTournesol opened 6 years ago

LaTournesol commented 6 years ago

Hi there,

I finally got the retrain_yolo.py to work on my own data, and I trained for a few hours and got the '.h5' files for each stage. But when I try to use my 'trained_stage_3_best.h5' as an input in the test_yolo.py file, I noticed that in test_tolo.py, the first argument is supposed to be a complete model, but the one I got from retrain_yolo.py is just the weights of the model.

Am I not supposed to use the output of the retrain_yolo.py to evaluate my model on test_yolo.py? or do I need to manually create the model first and load the weights? What is intended for the model_path argument of the test_yolo.py execution?

Please help, did anyone try to run test_yolo to evaluate their trained model? Thank you in advance!

alecGraves commented 6 years ago

You will need to manually recreate the model then load the weights. Then you can save the whole model or run predictions, whatever you want.

I tried to adress this problem in the Theano support branch by saving a yml for the model.

LaTournesol commented 6 years ago

@shadySource Thank you for the reply, I will try it.

y-kl8 commented 6 years ago

@LaTournesol , Hi, do yo know how to convert the VOC data into .npz format?

rileykwok commented 6 years ago

@shadySource how to I get the model architecture from retrain_yolo.py since only the weights are saved? i tried using the create_model from retrain_yolo.py but still not able to load my custom trained weights to the model.

rileykwok commented 6 years ago

@LaTournesol are you able to save the whole model?

LaTournesol commented 5 years ago

@LaTournesol , Hi, do yo know how to convert the VOC data into .npz format?

Hi, I wrote a small python script to compile the data into .npz format myself. It's easy to do and worth the time.

LaTournesol commented 5 years ago

@LaTournesol are you able to save the whole model?

Hi, no I wasn't able to save the whole model, I did what the author suggested, rebuild the model and load the weights.