fast-rcnn icon indicating copy to clipboard operation
fast-rcnn copied to clipboard

CPU Training error: smooth_L1_loss_layer Not Implemented Yet

Open sunshineatnoon opened this issue 8 years ago • 14 comments

I modified train_net.py to use cpu for training. I also disabled MATLAB and use the pre-computed selective search bounding box for VOC2007. However, I got this error during training:

Solving...
F0906 14:48:34.166416 13116 smooth_L1_loss_layer.cpp:39] Not Implemented Yet
*** Check failure stack trace: ***

I looked into fast-rcnn/caffe-fast-rcnn/src/caffe/layers/smooth_L1_loss_layer.cpp and found following code:

template <typename Dtype>
void SmoothL1LossLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
    const vector<Blob<Dtype>*>& top) {
  NOT_IMPLEMENTED;
}

template <typename Dtype>
void SmoothL1LossLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
    const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {
  NOT_IMPLEMENTED;
}

So I guess this layer is only implemented for GPU, not for CPU. Does this mean I can't use CPU to train fast-rcnn?

sunshineatnoon avatar Sep 06 '15 07:09 sunshineatnoon

+1

kaifeichen avatar Sep 10 '15 04:09 kaifeichen

@sunshineatnoon @kaifeichen @rbgirshick I got the same problem. Did you solve this problem ???

ghost avatar Sep 29 '15 03:09 ghost

@haimansx No, I have not solved the problem, I think the only way to solve the problem is by implementing the two functions above in c++

sunshineatnoon avatar Sep 29 '15 04:09 sunshineatnoon

Hi @haimansx, I think @sunshineatnoon is right. I just used the GPU version and it worked.

kaifeichen avatar Sep 29 '15 04:09 kaifeichen

Hi @sunshineatnoon I have followed your blog to train Fast-RCNN my own dataset and i have stumbled upon this error. I am using CPU Mode. Were you able to solve this issue?

@kaifeichen Does that mean Fast-RCNN is not implemented for CPU mode? Any updates on this would help me.

tanjoreg avatar Jan 21 '16 04:01 tanjoreg

@tanjoreg No, I haven't solved this issue. Fast Rcnn can only be trained on GPU as far as I know. But it can be tested on CPU.

sunshineatnoon avatar Jan 21 '16 04:01 sunshineatnoon

@sunshineatnoon Thank you very much,for the swift reply. Your blog helped me a lot. I have tested the imagenet demo on CPU and it works. I was trying to train my own dataset, which resulted in the error. Does that mean I have hit the wall with CPU mode?

tanjoreg avatar Jan 21 '16 04:01 tanjoreg

As I mentioned above, I think the way to solve this issue is to implement the two functions above in c++.

sunshineatnoon avatar Jan 21 '16 04:01 sunshineatnoon

+1

hnflee avatar Jan 21 '17 11:01 hnflee

@sunshineatnoon: Were you able to train R-CNN in cpu? or is it still in the status of not running training on cpu mode?

athulase avatar Mar 24 '17 18:03 athulase

I am facing the same problem!
Any help?
If someone implemented those 2 functions in cpp, can he post the code?

HamdiHamed1992 avatar Mar 27 '17 21:03 HamdiHamed1992

@HamdiHamed1992 , Do you solve this problem. There is someone write these 2 functions, but it still not work.

PeterJiangwy avatar Jan 16 '18 09:01 PeterJiangwy

@PeterJiangwy sorry no. I am using a CPU to train CNN and interested to segmentation not object localisation. Therefore i did not focus alot with RCNN, Fast RCNN and Faster RCNN. I can suggest you to use other network architectures and change just the final classification layers to your wanted task. Choose some already existing models that can run on CPU... (Segnet 4 example, based on VGG16 Model arch). If you need anything, feel free to ask.

HamdiHamed1992 avatar Jan 16 '18 10:01 HamdiHamed1992

@ HamdiHamed1992, Thank you. I’m newer to this scope. Now I’m trying to do something about object detection. Do you have any suggestions? Thank you very much for your help.

在 2018年1月16日,18:22,HamdiHamed1992 [email protected] 写道:

@PeterJiangwy https://github.com/peterjiangwy sorry no. I am using a CPU to train CNN and interested to segmentation not object localisation. Therefore i did not focus alot with RCNN, Fast RCNN and Faster RCNN. I can suggest you to use other network architectures and change just the final classification layers to your wanted task. Choose some already existing models that can run on CPU... (Segnet 4 example, based on VGG16 Model arch). If you need anything, feel free to ask.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rbgirshick/fast-rcnn/issues/53#issuecomment-357916252, or mute the thread https://github.com/notifications/unsubscribe-auth/ARw4KVKdCASfaD5tX2Q8yVBqxn2rzqZzks5tLHhLgaJpZM4F4ju-.

PeterJiangwy avatar Jan 16 '18 10:01 PeterJiangwy