pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.7k stars 21.33k forks source link

Problem with ZED and YOLO3 on Jetson TX2 #949

Open alessand01 opened 6 years ago

alessand01 commented 6 years ago

Hi, I'm having some problems in processing a stream from a ZED camera with yolo3 (darknet) on a TX2. I have done lots of tests and at the moment I'am trying to detect objects in an image loaded from the filesystem: the network can't find any objects if the ZED is opened (no need to call the grab function to produce this malfunctioning). Everything works well if I do not open the ZED.

Loading yolo3-tiny everything works well also with the ZED 'open'.

Any suggestion? Thanks!

alessand01 commented 6 years ago

Hi, I have rebuilt darknet without CUDNN (using GPU, OPENCV and OPENMP) and now it works. Is it possible that the use of CUDNN causes problems with ZED SDK?

The stereolabs support said that could be necessary to share with the ZED SDK the CUDA context of the application. Is it possible?

Thanks!

erwincoumans commented 6 years ago

I can into the same issue, running yolo v3 on TX2 hangs with ZED camera. It seems to work well using yolov3-tiny weights/cfg, not with the regular weights.

vidda13 commented 6 years ago

Hi. I am facing the same issue now too. Did anyone get yolov3 running ?

nesnes commented 6 years ago

If it's a CUDA context issue, using the same context in yolo and the ZED SDK should solve the issue. I'm don't know about yolo, but the ZED SDK offers the two possibilities:

Someone had a similar issue in python, and his solution was to swap the current context depending on the function to call: here

This guy seems to got it working recently, it might worth letting a comment to check what he used. Notice that he uses a laptop, is this a Jetson-specific issue?https://www.youtube.com/watch?v=EgaUq_dWclQ

adujardin commented 6 years ago

Hi, I found a similar issue (even on desktop), the program was running but no objects were found if I opened the ZED, and working fine otherwise. A solution that seems to work is to call cuda_set_device(0/*gpu_index*/); after the ZED is opened. Like :

  1. Open the ZED
  2. Call cuda_set_device
  3. Init and run the network

It may indeed be a context issue, but I still don't know exactly what's happening.

However, the difference between yolov3-tiny and regular yolov3 might come from the memory, it may be too much for the TX2.

yuye1992 commented 6 years ago

Hi, I want to use yolo3 on tx2, but when I load the yolo3 model, the program was killed when it is only loaded to the 102 layer. Is it insufficient memory?

shuxiao9058 commented 5 years ago

Hi, I want to use yolo3 on tx2, but when I load the yolo3 model, the program was killed when it is only loaded to the 102 layer. Is it insufficient memory?

Do you fixed the error?

adujardin commented 5 years ago

@yuye1992 @shuxiao9058 For the memory usage issue, you should make sure that the config file is correct, specifically in yolo3.cfg :

https://github.com/pjreddie/darknet/blob/f86901f6177dfc6116360a13cc06ab680e0c86b0/cfg/yolov3.cfg#L2-L7

It should be

# Testing
batch=1
subdivisions=1
# Training
#batch=64
#subdivisions=16