将自己数据集转化为lmdb格式
生活随笔
收集整理的這篇文章主要介紹了
将自己数据集转化为lmdb格式
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
在caffe-master_github/examples/imagenet/路徑下有convert_imagenet.sh文件,使用時(shí)有以下注意事項(xiàng)(注意點(diǎn)寫在了代碼注釋里):
#!/usr/bin/env sh # Create the imagenet lmdb inputs # N.B. set the path to the imagenet train + val data dirsEXAMPLE=examples/imagenet DATA=data/ilsvrc12 TOOLS=build/toolsTRAIN_DATA_ROOT=/path/to/imagenet/train/ VAL_DATA_ROOT=/path/to/imagenet/val/# Set RESIZE=true to resize the images to 256x256. Leave as false if images have # already been resized using another tool. RESIZE=false if $RESIZE; thenRESIZE_HEIGHT=256RESIZE_WIDTH=256 elseRESIZE_HEIGHT=0RESIZE_WIDTH=0 fiif [ ! -d "$TRAIN_DATA_ROOT" ]; thenecho "Error: TRAIN_DATA_ROOT is not a path to a directory: $TRAIN_DATA_ROOT"echo "Set the TRAIN_DATA_ROOT variable in create_imagenet.sh to the path" \"where the ImageNet training data is stored."exit 1 fiif [ ! -d "$VAL_DATA_ROOT" ]; thenecho "Error: VAL_DATA_ROOT is not a path to a directory: $VAL_DATA_ROOT"echo "Set the VAL_DATA_ROOT variable in create_imagenet.sh to the path" \"where the ImageNet validation data is stored."exit 1 fiecho "Creating train lmdb..."GLOG_logtostderr=1 $TOOLS/convert_imageset \--resize_height=$RESIZE_HEIGHT \--resize_width=$RESIZE_WIDTH \--shuffle \$TRAIN_DATA_ROOT \$DATA/train.txt \$EXAMPLE/ilsvrc12_train_lmdbecho "Creating val lmdb..."GLOG_logtostderr=1 $TOOLS/convert_imageset \--resize_height=$RESIZE_HEIGHT \--resize_width=$RESIZE_WIDTH \--shuffle \$VAL_DATA_ROOT \$DATA/val.txt \$EXAMPLE/ilsvrc12_val_lmdbecho "Done." 與50位技術(shù)專家面對面20年技術(shù)見證,附贈技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的将自己数据集转化为lmdb格式的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Spark Streaming 技术看点
- 下一篇: mysql 一对多 join_Mysql