카페 훈련 문제 총결산

1、Check failed: datum_channels > 0 (0 vs. 0). train.prototxt에서 Data type Annotated Data와 Data 호환,changing data type from "Annotated Data"to
Data” or “Data” to "AnnotatedData"


layer {
  name: "Data1"
  type: "AnnotatedData"
  top: "Data1"
  top: "Data2"
  transform_param {
    scale: 0.007842999882996082
    mirror: false
    mean_value: 127.0
  }
  data_param {
    source: "./train_lmdb/"
    batch_size: 64
    backend: LMDB
  }
}

2、Check failed: shape[i] <= 0x7fffffff/count_ (2688 vs. 344) blob size exceeds INT_MAX가lmdb 트레이닝 데이터를 생성할 때 그림을resize하고create 수정해야 합니다data.sh 수정,width=300,height=300
	
cur_dir=$(cd $( dirname ${BASH_SOURCE[0]} ) && pwd )
root_dir="/data/zhangrong/caffe/caffe-ssd/caffe"

cd $root_dir

redo=1
data_root_dir="/data/zhangrong/caffe/caffe-ssd/caffe/data/VOCdevkit"
dataset_name="MyDataSet"
mapfile="$root_dir/data/$dataset_name/labelmap_voc.prototxt"
anno_type="detection"
db="lmdb"
min_dim=0
max_dim=0
width=300
height=300

extra_cmd="--encode-type=jpg --encoded"
if [ $redo ]
then
  extra_cmd="$extra_cmd --redo"
fi
for subset in test trainval
do
  python $root_dir/scripts/create_annoset.py --anno-type=$anno_type --label-map-file=$mapfile --min-dim=$min_dim --max-dim=$max_dim --resize-width=$width --resize-height=$height --check-label $extra_cmd $data_root_dir $root_dir/data/$dataset_name/$subset.txt $data_root_dir/$dataset_name/$db/$dataset_name"_"$subset"_"$db examples/$dataset_name
done

3、math_functions.cpp:250] Check failed: a <=b <0 vs - 1.19209e-007> 해결: math 찾기functions.cpp, 경로가 ~/caffe/src/caffe/util인 math 찾기functions.cpp, 250번째 줄에서 오류가 발생한 곳을 찾습니다. 이중 평행봉 차단은 ~/caffe/src/caffe/util/sampler입니다.cpp, 검은색 부분을 굵게 하는 코드 추가
void SampleBBox(const Sampler& sampler, NormalizedBBox* sampled_bbox) {
// Get random scale.
CHECK_GE(sampler.max_scale(), sampler.min_scale());
CHECK_GT(sampler.min_scale(), 0.);
CHECK_LE(sampler.max_scale(), 1.);
float scale;
caffe_rng_uniform(1, sampler.min_scale(), sampler.max_scale(), &scale);
// Get random aspect ratio.
CHECK_GE(sampler.max_aspect_ratio(), sampler.min_aspect_ratio());
CHECK_GT(sampler.min_aspect_ratio(), 0.);
CHECK_LT(sampler.max_aspect_ratio(), FLT_MAX);
float aspect_ratio;
caffe_rng_uniform(1, sampler.min_aspect_ratio(), sampler.max_aspect_ratio(),
&aspect_ratio);
aspect_ratio = std::max(aspect_ratio, std::pow(scale, 2.));
aspect_ratio = std::min(aspect_ratio, 1 / std::pow(scale, 2.));
// Figure out bbox dimension.
float bbox_width = scale * sqrt(aspect_ratio);
float bbox_height = scale / sqrt(aspect_ratio);
if(bbox_width>=1.0){
bbox_width=1.0;
}
if(bbox_height>=1.0){
bbox_height=1.0;
}
// Figure out top left coordinates.
float w_off, h_off;
caffe_rng_uniform(1, 0.f, 1.0f - bbox_width, &w_off);
caffe_rng_uniform(1, 0.f, 1.0f - bbox_height, &h_off);
sampled_bbox->set_xmin(w_off);
sampled_bbox->set_ymin(h_off);
sampled_bbox->set_xmax(w_off + bbox_width);
sampled_bbox->set_ymax(h_off + bbox_height);
}

좋은 웹페이지 즐겨찾기