marco-willi / camera-trap-classifier

Automatically identify animals in camera trap images by training a deep neural network.
MIT License
49 stars 17 forks source link

transfer learning error #24

Closed meiyeeyip closed 4 years ago

meiyeeyip commented 4 years ago

Hi Marco,

I am trying to do transfer learning with the existing model model path : 'C:/Users/meiyip/Desktop/wildlife/my_model/save1/best_model.hdf5'

Below is the command I had tried ctc.train -train_tfr_path C:/Users/meiyip/Desktop/transfer_learning/tfr_files/ -val_tfr_path C:/Users/meiyip/Desktop/transfer_learning/tfr_files/ -test_tfr_path C:/Users/meiyip/Desktop/transfer_learning/tfr_files/ -class_mapping_json C:/Users/meiyip/Desktop/transfer_learning/tfr_files/label_mapping.json -run_outputs_dir C:/Users/meiyip/Desktop/transfer_learning/my_model/run1/ -model_save_dir C:/Users/meiyip/Desktop/transfer_learning/my_model/save1/ -model small_cnn -labels species count -batch_size 30 -n_cpus 4 -n_gpus 1 -buffer_size 512 -max_epochs 5 -early_stopping_patience 10
-transfer_learning -model_to_load C:/Users/meiyip/Desktop/wildlife/my_model/save1/best_model.hdf5 -output_width 224 -output_height 224

However I am getting error below:

image

Do you have an example on how transfer learning can be done using this repo?

Thank you. Mei Yee

marco-willi commented 4 years ago

Hi Mei Yee,

Your command looks fine to me. Can you confirm that the architecture of this model is 'small_cnn':

C:/Users/meiyip/Desktop/wildlife/my_model/save1/best_model.hdf5

If the architecture is different, you need do adjust the parameter 'model' accordingly.

You might be able to inspect the log file here to get more info and more detailed error messages (feel free to post if something is unclear):

C:/Users/meiyip/Desktop/transfer_learning/my_model/run1/

If you have confirmed that the model architectures match you could try this option (this may be necessary if the base model was trained on GPUs and you are trying to train on CPU):

-rebuild_model

Best, Marco

meiyeeyip commented 4 years ago

Hi Marco,

Thank you for your reply, I had recheck the model architecture and reset it. Now it is working fine. 👍

Regards, Mei Yee