Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
117 views
in Technique[技术] by (71.8m points)

python - Imagenet problem "Incorrect data field size"

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 a submission deadline.

question from:https://stackoverflow.com/questions/65838334/imagenet-problem-incorrect-data-field-size

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...