【发布时间】:2018-06-06 18:13:01
【问题描述】:
我想做微调来训练我的 jpg。在很多文档的指导下,我主要修改了create_imagenet.sh中data、txt和tool的路径,如下:
#!/usr/bin/env sh
# This script converts the mnist data into lmdb/leveldb format,
# depending on the value assigned to $BACKEND.
set -e
EXAMPLE=/home/sun/Documents/python/fine-tuning/Oxford102/data/test
DATA_TEST=/home/sun/Documents/python/fine-tuning/Oxford102/data/test/test/
DATA_TRAIN=/home/sun/Documents/python/fine-tuning/Oxford102/data/test/train/
NOTI=/home/sun/Documents/python/fine-tuning/Oxford102/data/test
BUILD=/home/sun/Documents/caffe/build/tools
#BACKEND="lmdb"
# Set RESIZE=true to resize the images to 256x256. Leave as false if images have
# already been resized using another tool.
RESIZE=true
if $RESIZE; then
RESIZE_HEIGHT=256
RESIZE_WIDTH=256
else
RESIZE_HEIGHT=0
RESIZE_WIDTH=0
fi
if [ ! -d "$DATA_TRAIN" ]; then
echo "Error: TRAIN_DATA_ROOT is not a path to a directory: $DATA_TRAIN"
echo "Set the TRAIN_DATA_ROOT variable in create_imagenet.sh to the path" \
"where the ImageNet training data is stored."
exit 1
fi
if [ ! -d "$DATA_TEST" ]; then
echo "Error: TRAIN_DATA_ROOT is not a path to a directory: $DATA_TEST"
echo "Set the TRAIN_DATA_ROOT variable in create_imagenet.sh to the path" \
"where the ImageNet training data is stored."
exit 1
fi
echo "Creating train lmdb..."
GLOG_logtostderr=1 $BUILD/convert_imageset \
--resize_height=$RESIZE_HEIGHT \
--resize_width=$RESIZE_WIDTH \
--shuffle \
$DATA_TRAIN \
$NOTI/info_train.txt \
$EXAMPLE/img_train_lmdb
echo "Creating test lmdb..."
GLOG_logtostderr=1 $BUILD/convert_imageset \
--resize_height=$RESIZE_HEIGHT \
--resize_width=$RESIZE_WIDTH \
--shuffle \
$DATA_TEST \
$NOTI/info_test.txt \
$EXAMPLE/img_test_lmdb
echo "Done."
然后我在终端中运行“sudo sh create_oxford.sh”,但一无所获。
另外,我的文档结构如下:
在 /home/sun/Documents/python/fine-tuning/Oxford102/data/test 中,我放置了 info_test.txt、info_train.txt、test(jpg 用于测试)和 train(jpg 用于火车)。在txt中,信息类似于'image_0001.jpg 0'。
【问题讨论】:
标签: linux machine-learning caffe lmdb