【发布时间】:2019-12-26 20:01:56
【问题描述】:
我是机器学习的新手,我是使用 caffe 框架准备人脸检测模型的新手。 我已经创建了我的数据,对其进行了排序。我创建了 train.txt 和 val.txt,其中三元分类和图像类也相应地在各自的存储库中移动了图片。
现在,当我为训练准备数据库时,我无法成功转换 lmdb 文件夹。我总是遇到问题。
首先我认为我的路径不正确,但我尝试了所有方法,但仍然遇到错误。这是错误和代码的图片。
谁能帮我解决这个问题。
我运行以下脚本来创建 lmdb (sh examples/FaceDetection/create_lmdb.sh)
#!/usr/bin/env sh
# Create the imagenet lmdb inputs
# N.B. set the path to the imagenet train + val data dirs
EXAMPLE=/home/hashim/caffe/examples/imagenet
DATA=/home/hashim/Desktop/IVP/Face_6k
TOOLS=build/tools
TRAIN_DATA_ROOT=/home/hashim/Desktop/IVP/Face_6k
VAL_DATA_ROOT=/home/hashim/Desktop/IVP/Face_6k
# 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."
我得到以下输出:
正在创建火车 lmdb...
I1226 10:25:36.794904 3324 convert_imageset.cpp:86] Shuffling data
I1226 10:25:36.795342 3324 convert_imageset.cpp:89] A total of 3602 images.
F1226 10:25:36.796409 3324 db_lmdb.cpp:13] Check failed: mkdir(source.c_str(), 0744) == 0 (-1
vs. 0) mkdir /home/hashim/caffe/examples/imagenet/ilsvrc12_train_lmdb failed
*** Check failure stack trace: ***
@ 0x7fe6b4bf20cd google::LogMessage::Fail()
@ 0x7fe6b4bf3f33 google::LogMessage::SendToLog()
@ 0x7fe6b4bf1c28 google::LogMessage::Flush()
@ 0x7fe6b4bf4999 google::LogMessageFatal::~LogMessageFatal()
@ 0x7fe6b4febbe8 caffe::db::LMDB::Open()
@ 0x558490bb05e9 (unknown)
@ 0x7fe6b39f2b97 __libc_start_main
@ 0x558490bb186a (unknown)
Aborted (core dumped)
Creating val lmdb...
I1226 10:25:36.966315 3334 convert_imageset.cpp:86] Shuffling data
I1226 10:25:36.966552 3334 convert_imageset.cpp:89] A total of 1197 images.
F1226 10:25:36.966617 3334 db_lmdb.cpp:13] Check failed: mkdir(source.c_str(), 0744) == 0 (-1 vs. 0) mkdir /home/hashim/caffe/examples/imagenet/ilsvrc12_val_lmdb failed
*** Check failure stack trace: ***
@ 0x7f999df730cd google::LogMessage::Fail()
@ 0x7f999df74f33 google::LogMessage::SendToLog()
@ 0x7f999df72c28 google::LogMessage::Flush()
@ 0x7f999df75999 google::LogMessageFatal::~LogMessageFatal()
@ 0x7f999e36cbe8 caffe::db::LMDB::Open()
@ 0x5614b3ed95e9 (unknown)
@ 0x7f999cd73b97 __libc_start_main
@ 0x5614b3eda86a (unknown)
Aborted (core dumped)
Done.
请帮我解决这个问题。谢谢。
【问题讨论】:
-
您是否尝试过以管理员权限运行您的脚本?类似 chmod 777