-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Object detection example fails (Caffe with support for Faster-RCNN) #142
Comments
(I pushed a few commits to tidy up the object detection app, so I'd pull those before following below.) Getting py-faster-rcnn to work is usually pretty finicky. In the past, I've had success with your option 3 by following these steps.
Hopefully this should get you up and running with faster-rcnn. This is obviously an annoying process (due largely to the incompatibility of multiple Caffe versions) so I agree that we need to migrate to a more modern detection framework, such as Detectron or the TensorFlow object detection API. |
Thanks for the response! I've followed your instructions to try to make this work, but Scanner is now segfaulting almost immediately when running the object detection example. I compiled with debug symbols, ran GDB, and managed to get at least a partial stack trace:
It appears that the caffe_input_transformer_gpu function, which then calls Halide, is involved. Unfortunately I don't know anything about Halide, so I can't troubleshoot further. |
If you change the device type being used for the 'CaffeInput' operation to CPU from GPU, that should resolve the issue. We have noticed issues with GPU halide in the past. |
I pushed a few commits which make that modification for you, so if you pull the most recent code, the example should work! |
Thanks! That fixed the problem with Halide. The object-detection example now gets through ingesting the video and crashes due to an issue with ffmpeg:
I haven't had time to fully troubleshoot this one yet, but it looks like ffmpeg might just be getting passed incorrect parameters somewhere. If you have any ideas about what's going wrong, that would be great! |
Could you run |
Sure:
|
This seems like an issue with OpenCV (which is being used to encode the video here). Can you run |
I agree, it seems like an issue with OpenCV. I'm looking into the cvCreateVideoWriter_FFMPEG functions to see if anything looks obviously broken (like incorrect parameters being passed to FFmpeg), but it's slow going since I don't really know either code base. Anyway, here's my $PYTHONPATH: |
Do you have a native installation of OpenCV outside of the one in the scanner thirdparty directory? Additionally, you should point your |
I don't think I have another OpenCV install (it's a relatively fresh installation of Ubuntu 16.04), but I'll check. Thanks for pointing out the discrepancy with my path, I'll fix that and see if it makes a difference. |
OK, there were a few older OpenCV libraries hanging around for some reason. So I've deleted those, and PYTHONPATH is now:
Unfortunately I still get the same error. |
It should actually be |
Hmm... I don't have a |
FWIW, I do have Sorry if I am a bit naive, I don't do much python development... |
No worries, it seems like there is no consensus on whether it should be named |
Yep |
Can you insert some print statements in Specifically... L82: Insert |
Just edited the above comment with the print statements |
OK, I've got:
But I don't get any additional output when running: it looks like the script doesn't even get that far. |
Can you place a print right after initializing the If it isn't, it might be that the h264 encoder isn't working. You could try changing *'X264' to *'MJPG' to see if a different video encoder might work. |
Huh, so it looks like it is not getting past the When I change the encoder type to MJPG, I get an error that library doesn't exist:
I'm wondering now if this is an ffmpeg/Ubuntu problem: maybe my h264 encoder isn't configured properly. |
Can you show me the output of |
Sure, here you go:
|
Well... after playing around with it for a bit, I discovered that the output file extension seems to make a difference. Reading online it sounds like the video encoder situation is different depending on your OS, and that some of the defaults in Ubuntu are broken. So all I did was change to the MJPG encoder with a .avi extension, and the object-detection example runs to completion:
Thank you so much for the help! |
Ah, I think I've run into that issue a long time ago! Glad it was resolved. If you end up writing something in Scanner, would love to hear what it was and what your experience of the system is! |
Thanks, I'll keep you posted! |
Hi, I'm running into an issue with Scanner's integration with Caffe for object detection. I'm trying to run the example in "examples/apps/object_detection/main.py" on a fresh install of Scanner, and it fails with the following output:
[libprotobuf ERROR google/protobuf/text_format.cc:288] Error parsing text-format caffe.NetParameter: 483:21: Message type "caffe.LayerParameter" has no field named "roi_pooling_param".
After looking into this, it appears that the Intel version of Caffe (which you get if you build Scanner without GPU) supports Faster-RCNN out of the box, while the BVLC version does not. When I build Scanner without GPU support, the object-detection example doesn't run at all.
I've tried a few different workarounds:
The "right" answer here might be to integrate Scanner with Detectron, but I'm hoping for an easier solution that just to get started. Anyone else run into this or have any ideas?
The text was updated successfully, but these errors were encountered: