ShaoqingRen / faster_rcnn

Faster R-CNN
Other
2.7k stars 1.22k forks source link

FASTER RCNN Demo crashes even after successful caffe and matcaffe built on 2015b and 2016a Linux #112

Open hasanirtiza opened 8 years ago

hasanirtiza commented 8 years ago

I have successfully built cafe and matcaffe . I ran mattest() which ran all 6 test successfully. However, when I try to run the 'script_faster_rcnn_demo.m' it runs fine for the first time. Amazingly, when I try to re-run it on same Matlab session Matlab crashes at line 10 where you call active_caffe_mex and more specifically further inside setdevice line 9 caffe('set_device').

On console this is the error I receive (ERROR: something wrong with flag 'logtostderr' in file 'src/logging.cc'. One possibility: file 'src/logging.cc' is being linked both statically and dynamically into this executable) .I could nto figure it out which function or mex-file is messing it up. I have tried reinstalling everything, but to no luck. The same error persist on CPU as well. So my impression is, it cannot be memory or GPU.

My hardware and system state is

@ShaoqingRen @rbgirshick

If you guys have any idea or anyone encountered and solve this issue.

Regards

hongkaiyu2012 commented 7 years ago

I got the same problem. When I run script_faster_rcnn_demo.m for the first time, code is running successfully and the results for the five sample images are very amazing. But when I run script_faster_rcnn_demo.m for the second time, the matlab crashes.

hasanirtiza commented 7 years ago

The problem is actually with caffe and GPU. You can partly solve the issue by removing lines from 4 to 10 and copy these lines(4 to 10) into startup.m. Run startup.m once per Matlab session. You can also put caffe.reset_all() at the top of demo script . Should work

hongkaiyu2012 commented 7 years ago

Thanks.

I try your method and it does not work for me. Matlab crashes again and give the following error information in the terminal:

[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: caffe.proto [libprotobuf FATAL google/protobuf/descriptor.cc:954] CHECK failed: generateddatabase->Add(encoded_file_descriptor, size):

hongkaiyu2012 commented 7 years ago

Update. I fixed this problem.

I did exactly as hasanirtiza told me except putting caffe.reset_all() in the top. But, we need to do one more thing. I commented the line 121 %clear mex; in script_faster_rcnn_demo.m.

Then, I can run the demo for multiple times without matlab crash. Thanks to hasanirtiza!!!

MXLHELLO commented 4 years ago

Thanks.

I try your method and it does not work for me. Matlab crashes again and give the following error information in the terminal:

[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: caffe.proto [libprotobuf FATAL google/protobuf/descriptor.cc:954] CHECK failed: generateddatabase->Add(encoded_file_descriptor, size):

How did you solve this problem?