如何解决Imagenet 问题“数据字段大小不正确”
我是 Caffe 的新手。当我运行 make_imagenet_mean.sh 有一个错误信息:
F0122 02:13:50.257007 6589 compute_image_mean.cpp:77] Check Failed: size_in_datum == data_size (254700 vs. 116412) Incorrect data field size 254700
*** Check failure stack trace: ***
@ 0x7f458acab1c3 google::LogMessage::Fail()
@ 0x7f458acb025b google::LogMessage::SendToLog()
@ 0x7f458acaaebf google::LogMessage::Flush()
@ 0x7f458acab6ef google::LogMessageFatal::~LogMessageFatal()
@ 0x55e70fe96f90 main
@ 0x7f458a5b20b3 __libc_start_main
@ 0x55e70fe9748e _start
Aborted (core dumped)
Done.
这是 create_imagenet.sh 脚本:
#!/usr/bin/env sh
#Create the imagenet lmdb inputs # N.B. set the path to the imagenet train + val data dirs
`
set -e
EXAMPLE=/home/manraj/caffe/examples/FaceDetection
DATA=/home/manraj/caffe/examples/FaceDetection
TOOLS=/home/manraj/caffe/build/tools
TRAIN_DATA_ROOT=/home/manraj/caffe/examples/FaceDetection/train_face
VAL_DATA_ROOT=/home/manraj/caffe/examples/FaceDetection/val_face
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; then
RESIZE_HEIGHT=256
RESIZE_WIDTH=256
else
RESIZE_HEIGHT=0
RESIZE_WIDTH=0
fi
if [ ! -d "$TRAIN_DATA_ROOT" ]; then
echo "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
fi
if [ ! -d "$VAL_DATA_ROOT" ]; then
echo "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
fi
echo "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_lmdb
echo "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_lmdb
echo "Done."
还有这个 make_imagenet_mean.sh 脚本:
#!/usr/bin/env sh
#Compute the mean image from the imagenet training lmdb # N.B. this is available in data/ilsvrc12
EXAMPLE=/home/manraj/caffe/examples/FaceDetection
DATA=/home/manraj/caffe/data/ilsvrc12
TOOLS=/home/manraj/caffe/build/tools
$TOOLS/compute_image_mean $EXAMPLE/ilsvrc12_train_lmdb \
$DATA/imagenet_mean.binaryproto
``echo "Done."``
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。