caffe icon indicating copy to clipboard operation
caffe copied to clipboard

problem in training ssd

Open 123chengbo opened this issue 10 years ago • 16 comments

Dear weiliu89: I'am new to ssd、and caffe. I tried to train a ssd-model with VOC2007dataset(both trainval、test,convert them to lmdb files), then run ssd_pascal.py to train ,here is the problem: sgd_solver.cpp:106] Iteration 13100,lr = 0.001 math_functions.cpp:250] Check failed: a <= b <0 vs -1.19209e-007> *** Check failure stack trace ***. I think there may be something wrong with my dataset,but i use voc2007 datases、and i don't know how to deal with it. Could you help me? Thank you.

123chengbo avatar Sep 29 '16 09:09 123chengbo

Did you change the batch_sampler?

weiliu89 avatar Sep 29 '16 18:09 weiliu89

No,I have never changed the batch_sample parameters(and i compare it to the original ssd_pascal.py files)Should i change it?

i run it again,this time it comes in the place :iteration = iteration. sgd_solver.cpp:106] Iteration 18500,lr = 0.001 math_functions.cpp:250] Check failed: a <= b <0 vs -1.19209e-007> *** Check failure stack trace ***.

123chengbo avatar Sep 30 '16 03:09 123chengbo

What does the failure stack trace back to? Is it an error in this function?

weiliu89 avatar Sep 30 '16 04:09 weiliu89

The error is in the "math_functions.cpp"、Line 250,
caffe_rng_uniform(){ ......... CHECK_LE(a, b); //Check failed: a <= b <0 vs -1.19209e-007> }

123chengbo avatar Sep 30 '16 06:09 123chengbo

But what is the function that calls caffe_rng_uniform?

weiliu89 avatar Sep 30 '16 06:09 weiliu89

i can't find which functions calls caffe_rng_uniform exactly, there are some functions calls caffe_rng_uniform . the error suddenly happened, i can't find out which functions calls it at the moment.

123chengbo avatar Sep 30 '16 07:09 123chengbo

Hello, I am running into a similar issue. My callstack is:

- caffe::caffe_rng_uniform<float>
- caffe::  SampleBBox
- caffe::  GenerateBatchSamples
- caffe::AnnotatedDataLayer<float>::  load_batch
- caffe::BasePrefetchingDataLayer<float>::  InternalThreadEntry

dtmoodie avatar Oct 14 '16 21:10 dtmoodie

@123chengbo 你好,我也遇到了这个问题,请问找到原因了吗?我是在win10下运行的 ssd_pascal.py 用的voc0712 cpu模式

jianan86 avatar Oct 21 '16 01:10 jianan86

没能解决,我在GPU下训练,我的机子上这个问题出现的频率不算太高(少的话几千iterations、多的话2万iterations),所以我只好把保存模型的间隔设得很小(2000次),一旦断了就再启动一下接着跑,这样勉强也跑了100000iterations。 我还遇到一个问题:windows下的性能感觉 很奇怪 ?SSD_300x300的模型,我在 CPU下测试一张图片耗时3s多、GPU下耗时400多ms,TITAN X的显卡,分辨率500X400多。感觉太费了,但是不知道 怎么 查。 @jianan86

123chengbo avatar Oct 21 '16 03:10 123chengbo

@weiliu89 ,I run SSD on Windows,GPU(I have only one TITAN X),but i found it takes too many times to detect pictures(average 400ms per picture,in the VOC2007 datasets);As it run in CPU mode,it is 3s per picture。 It seems very strange。 have you ever run SSD on windows?Would you give me some advices on how to check it

123chengbo avatar Oct 21 '16 03:10 123chengbo

hello, i also meet this problem. math_functions.cpp:250] Check failed: a <= b (0 vs. -2.38419e-07) i find the error occurs here:

SampleBBox(){
  ...
 // Check failed  if bbox_width ==1
  caffe_rng_uniform(1, 0.f, 1 - bbox_width, &w_off);
//Check failed if bbox_height ==1
  caffe_rng_uniform(1, 0.f, 1 - bbox_height, &h_off);
   ...
}

this is due to float precision issue.
if bbox_height == 1, 1- bbox_height will be a very small number (not 0) ,may be 1.19209e-007 so , we should do some check before pass it to caffe_rng_uniform :

float b = 1 - bbox_width;
if (abs(b) < 1e-7) b = 0.0f;
caffe_rng_uniform(1, 0.f, b, &w_off);

float have 7 digits of decimal precision , so we compare b with 1e-7.

CrazySssst avatar Jul 06 '17 08:07 CrazySssst

@dtmoodie hi, how do you solve this problem? I have the same failure stack trace as you.

fnzhan avatar Jul 07 '17 14:07 fnzhan

Hello,

I know the problem was solved, possibly by itself? I don't remember doing anything. It may have been an updated version that works.

dtmoodie avatar Jul 07 '17 19:07 dtmoodie

@CrazySssst Hi, have you solved the problem by this way? my stack trace is: Check failed: a <= b (0 vs. -1.19209e-07). I tried this method but still report the same problem, need any other operation?

fnzhan avatar Jul 08 '17 13:07 fnzhan

@frankzhan1992 yes, it works for me. i think you should find where the problem is ( which lines )

CrazySssst avatar Jul 10 '17 02:07 CrazySssst

I met the same problem,I had changed the ssd_pascal.py to solve #Evaluate on whole test set num_test_image=***(your test images) test_abtch_size=1

FloraBF avatar Dec 05 '17 09:12 FloraBF