Skip to content

Scripts for iterative training with multiple models and datasets using Caffe framework.

License

Notifications You must be signed in to change notification settings

dennishnf/caffe-cnn-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

caffe-cnn-scripts

Scripts for iterative training with multiple models and datasets.

a. for a single iteration

  1. With scripts/generate_lmdb.py generate the "train.txt"/"test.txt", "train_lmdb"/"test_lmdb", "mean_image.binaryproto" files.

  2. Verify models/model-NN/ model_train_val.prototxt model_deploy.prototxt the inputs, parameters of architecture like the size of conv, outputs.

  3. Verify in models/model-NN/model_solver.prototxt the model and iterations.

  4. Train the network, in terminal:

$ cd /home/dennis/Desktop/cnn-caffe-scripts/
$ caffe train --solver /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/model_solver.prototxt --gpu 0

Note: Fine tunning:

$ caffe train --solver /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/model_solver.prototxt --weights /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/bvlc_alexnet.caffemodel --gpu 0

Note: Resume training:

$ caffe train --solver /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/model_solver.prototxt --snapshot /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/train_iter_10000.solverstate
  1. Test the network, in terminal:
$ cd /home/dennis/Desktop/cnn-caffe-scripts/
$ python /home/dennis/Desktop/cnn-caffe-scripts/scripts/testing_v2.py --proto /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/model_deploy.prototxt --model /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/train_iter_6000.caffemodel --mean /home/dennis/Desktop/cnn-caffe-scripts/input/dataset-MM/mean_image.binaryproto --txt /home/dennis/Desktop/cnn-caffe-scripts/input/dataset-MM/test.txt --cm none
$ python /home/dennis/Desktop/cnn-caffe-scripts/scripts/testing_v1.py --proto /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/model_deploy.prototxt --model /home/dennis/Desktop/cnn-caffe-scripts/models/model-NN/train_iter_6000.caffemodel --mean /home/dennis/Desktop/cnn-caffe-scripts/input/dataset-MM/mean_image.binaryproto --lmdb /home/dennis/Desktop/cnn-caffe-scripts/input/dataset-MM/test_lmdb
  1. Draw the model and see the colvolutional filters:
cd /home/dennis/Desktop/cnn-caffe-scripts/scripts
$ python /home/dennis/caffe/python/draw_net.py /home/dennis/Desktop/cnn-caffe-scripts/models/model01/model_train_val.prototxt /home/dennis/Desktop/cnn-caffe-scripts/models/model01/model.png
$ python visualize_example.py

b. for single and multiple iterations

  1. With scripts/generate_lmdb.py generate the "train.txt"/"test.txt", "train_lmdb"/"test_lmdb", "mean_image.binaryproto" files.

  2. Verify models/model-NN/ model_train_val.prototxt model_deploy.prototxt the inputs, parameters of architecture like the size of conv, outputs.

  3. Verify in models/model-NN/model_solver.prototxt the model and iterations.

  4. Then, use scripts/recursive_train.py, this script automatically train, test, draw models, and show convolutional filters.

License

GNU General Public License, version 3 (GPLv3).

About

By: Dennis Núñez-Fernández

Website: http://dennishnf.com

Releases

No releases published

Packages

No packages published

Languages