Skip to content

Failure to run the model

Amy Kendig edited this page Jul 25, 2019 · 2 revisions

We tried to train and test the model, but experienced errors.

## Training configuration

# From inside the container,
# Download ImageNet-trained model
# in plantvillage
$ mkdir models
$ cd models
$ wget http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel

# Edit configuration files
$ cd plantvillage_deeplearning_paper_analysis/googLeNet/color-80-20/finetune
# change paths in train_val.prototxt to /plantvillage/plantvillage_deeplearning_paper_dataset/lmdb
# change snapshot_prefix in solver.prototxt to "/plantvillage/plantvillage_deeplearning_paper_analysis/googLeNet/color-80-20/finetune/snapshots_" and solver_mode to CPU
# change paths in iter_1823.prototxt to /plantvillage/plantvillage_deeplearning_paper_dataset/lmdb
# Figure out which script to use to do the above automatically

# to reduce dataset for checking: 
# change batch size to 1 in train_val.prototxt
# change and max_iter to 2000 in solver.prototxt
# change batch size to 1 in iter_1823.prototxt

## Train the model 

$ cd /plantvillage/plantvillage_deeplearning_paper_analysis/googLeNet/color-80-20/finetune
$ caffe train -solver solver.prototxt -weights /plantvillage/models/bvlc_googlenet.caffemodel &> caffe.log
> Error in `caffe': double free or corruption (out)

## Test the model

$ cd /plantvillage/plantvillage_deeplearning_paper_analysis/googLeNet/color-80-20/finetune
$ mkdir hdf5_dumps
$ caffe test -model test_prototxts/iter_1823.prototxt -weights /plantvillage/googLeNet_color-80-20_finetune/snapshots__iter_1823.caffemodel -iterations 2 &> ./test_logs/iter_1823.log
> Error detected in HDF5 (1.8.16) thread 140403358030528
# we deleted the HDF5 layer from iter_1823.prototxt, and re-ran this code
> Error in `caffe': double free or corruption (out)