train image classfication network by caffe
This repo is organized as follows:
caffe_cls_demo/
├── data
├── imgs
└── labels
├── README.md
├── caffe_pred.py
├── lmdb_io.py
├── deploy.prototxt
└── solver.prototxt
- caffe==1.0.0
- python==3.6.8
- numpy
- opencv==3.4.1
- Python packages might missing. pls fix it according to the error message.
- Clone the caffe_cls_caffe repository.
git clone https://github.com/vicwer/caffe_cls_caffe.git
- Create data, lmdb and models directory.
data should be organized as follows:
data/
|->labels/train.txt
|->labels/test.txt
|->imgs/*.png
-
Download dataset
-
Generate img_list.txt formatted as "img_path label"
-
Generate train.txt and test.txt formatted as "img_path label"
-
Generate lmdb:
python3 lmdb_io.py
caffe train --solver=deploy.prototxt -gpu 0
python3 caffe_pred.py