caffe模型中的作物大小错误 [英] Crop size Error in caffe Model
问题描述
我正在尝试训练caffe模型.出现此错误
I0806 09:41:02.010442 2992 sgd_solver.cpp:105] Iteration 360, lr = 9.76e- 05
F0806 09:41:20.544955 2998
data_transformer.cpp:168] Check failed: height<=datum_height (224 vs. 199)
*** Check failure stack trace: ***
@ 0x7f82b051edaa (unknown)
@ 0x7f82b051ece4 (unknown)
@ 0x7f82b051e6e6 (unknown)
@ 0x7f82b0521687 (unknown)
@ 0x7f82b0b8e9e0 caffe::DataTransformer<>::Transform()
@ 0x7f82b0c09a2f caffe::DataLayer<>::load_batch()
@ 0x7f82b0c9aa5
caffe::BasePrefetchingDataLayer<>::InternalThreadEntry()
@ 0x7f82b0b6ea30 caffe::InternalThread::entry()
@ 0x7f82b0b6f376 boost::detail::thread_data<>::run()
@ 0x7f82a6afea4a (unknown)
@ 0x7f82a1147184 start_thread
@ 0x7f82aee51ffd (unknown)
@ (nil) (unknown)
Aborted (core dumped)
我遇到了类似的错误,但Check failed: height<=datum_height (227 vs. 224)
.然后我将227更改为224,但是现在我明白了.有什么建议吗?
我的LMDB代码-
EXAMPLE=/home/hyperworks/colorfile/ # Path where the output LMDB is stored
DATA=/home/hyperworks/colorfile/ # Path where the data.txt file is present
TOOLS=/home/hyperworks/caffe/build/tools/ # Caffe dependency to access the convert_imageset utility
DATA_ROOT=/home/hyperworks/colorfile/train/ # Path prefix for each entry in data.txt
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# ----------------------------
RESIZE=true
if $RESIZE; then
RESIZE_HEIGHT=227
RESIZE_WIDTH=227
else
RESIZE_HEIGHT=0
RESIZE_WIDTH=0
fi
# Checks for DATA_ROOT Path
if [ ! -d "$DATA_ROOT" ]; then
echo "Error: DATA_ROOT is not a path to a directory: $DATA_ROOT"
echo "Set the DATA_ROOT variable to the path where the data
instances are stored."
exit 1
fi
# ------------------------------
# Creating LMDB
echo "Creating data lmdb..."
GLOG_logtostderr=1 $TOOLS/convert_imageset \
$DATA_ROOT \
$DATA/train.txt \
$EXAMPLE/train_lmdb
# ------------------------------
echo "Done."
这是我用来创建LMDB文件的代码- 这是我用来创建LMDB文件的代码-
输入数据集中的一个(或多个?)图像似乎具有height
=199.Caffe无法将高度199的图像裁剪为224尺寸. /p>
错误消息说明:
data_transformer.cpp:168] Check failed: height<=datum_height (224 vs. 199)
查看 'data_transformer.cpp'
第168行:
CHECK_LE(height, datum_height);
数据转换器检查作物高度(height
)是否小于或等于输入datum_height
的(LE).
从错误消息中可以看到,此检查失败,这意味着输入高度大于裁切高度.条件height=224 <= datum_height=199
不成立,并引发错误.
Im trying to train a caffe Model.I get this error
I0806 09:41:02.010442 2992 sgd_solver.cpp:105] Iteration 360, lr = 9.76e- 05
F0806 09:41:20.544955 2998
data_transformer.cpp:168] Check failed: height<=datum_height (224 vs. 199)
*** Check failure stack trace: ***
@ 0x7f82b051edaa (unknown)
@ 0x7f82b051ece4 (unknown)
@ 0x7f82b051e6e6 (unknown)
@ 0x7f82b0521687 (unknown)
@ 0x7f82b0b8e9e0 caffe::DataTransformer<>::Transform()
@ 0x7f82b0c09a2f caffe::DataLayer<>::load_batch()
@ 0x7f82b0c9aa5
caffe::BasePrefetchingDataLayer<>::InternalThreadEntry()
@ 0x7f82b0b6ea30 caffe::InternalThread::entry()
@ 0x7f82b0b6f376 boost::detail::thread_data<>::run()
@ 0x7f82a6afea4a (unknown)
@ 0x7f82a1147184 start_thread
@ 0x7f82aee51ffd (unknown)
@ (nil) (unknown)
Aborted (core dumped)
I was getting a similar error but Check failed: height<=datum_height (227 vs. 224)
.I then changed 227 to 224 ,but now i get this.Any suggestions?
EDIT:My code for LMDB-
EXAMPLE=/home/hyperworks/colorfile/ # Path where the output LMDB is stored
DATA=/home/hyperworks/colorfile/ # Path where the data.txt file is present
TOOLS=/home/hyperworks/caffe/build/tools/ # Caffe dependency to access the convert_imageset utility
DATA_ROOT=/home/hyperworks/colorfile/train/ # Path prefix for each entry in data.txt
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# ----------------------------
RESIZE=true
if $RESIZE; then
RESIZE_HEIGHT=227
RESIZE_WIDTH=227
else
RESIZE_HEIGHT=0
RESIZE_WIDTH=0
fi
# Checks for DATA_ROOT Path
if [ ! -d "$DATA_ROOT" ]; then
echo "Error: DATA_ROOT is not a path to a directory: $DATA_ROOT"
echo "Set the DATA_ROOT variable to the path where the data
instances are stored."
exit 1
fi
# ------------------------------
# Creating LMDB
echo "Creating data lmdb..."
GLOG_logtostderr=1 $TOOLS/convert_imageset \
$DATA_ROOT \
$DATA/train.txt \
$EXAMPLE/train_lmdb
# ------------------------------
echo "Done."
This is the code i used to create the LMDB files- This is the code i used to create the LMDB files-
It seems like one (or more?) images in your input dataset has height
= 199. Caffe cannot crop image with height 199 to size 224.
Error message explained:
data_transformer.cpp:168] Check failed: height<=datum_height (224 vs. 199)
Looking at the 'data_transformer.cpp'
line 168:
CHECK_LE(height, datum_height);
the data transformer checks that the crop height (height
) is less than or equal (LE) to the input datum_height
.
As you can see from the error message, this check failed, meaning input height is larger than the crop height. The condition height=224 <= datum_height=199
does not hold and an error is raised.
这篇关于caffe模型中的作物大小错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!