convert_imageset [FLAGS] ROOTFOLDER/ LISTFILE DB_NAME
FLAG: -backend :lmdb/leveldb for storing the result, default: “lmdb” -gray (When this option is on, treat images as grayscale ones) type: bool default: false -resize_height (Height images are resized to) type: int32 default: 0 -resize_width (Width images are resized to) type: int32 default: 0 -shuffle (Randomly shuffle the order of images and their labels) type: bool default: false
参照例子,我写了一个shell文件 create.sh
#!/usr/bin/env sh# This script converts the image data into leveldb/lmdb format.TOOLS=/home/chuny/Downloads/caffe/build/toolsRESIZE_HEIGHT=256RESIZE_WIDTH=256DATADIR=/home/chuny/temp/datadirDATA=/home/chuny/temp/dataecho "Creating train leveldb..."GLOG_logtostderr=1 $TOOLS/convert_imageset / --resize_height=$RESIZE_HEIGHT / --resize_width=$RESIZE_WIDTH / --shuffle / $DATADIR/ / $DATA/train.txt / $DATA/train_imdb echo "Creating val leveldb..."GLOG_logtostderr=1 $TOOLS/convert_imageset / --resize_height=$RESIZE_HEIGHT / --resize_width=$RESIZE_WIDTH / --shuffle / $DATADIR/ / $DATA/val.txt / $DATA/val_imdb新闻热点
疑难解答