BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
33.96k stars 18.72k forks source link

Imagenet problem "Incorrect data field size #6992

Open Mantrap7 opened 3 years ago

Mantrap7 commented 3 years ago

Hello, I am new in Caffe. When I run make_imagenet_mean.sh there is a error information

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.

this is the create_imagenet.sh script

!/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."

and this make_imagenet_mean.sh script

!/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."``

Please help guys I am stuck here and I have s submission deadline