-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
run yolov3 with GPU:CUDA Error: out of memory #791
Comments
I meet the same problem. |
@dayn9t I think your gpu is low in memory. when Yolov3 fully loaded to gpu, it takes about 1600MB memory by default setting(416*416) on my computer, plus 300ish MiB from display and other applications, it is very like it will throw out OOM error. Try to run on a gpu with larger memory or reduce the width and height setting in your cfg file(Note: reducing the size might impact your detection results.). |
Try to reboot and it may help. |
thanks @hjchai . |
I had the same problem with a GT740M with 4096Mo GDDR4 memory. Nvidia 384.130, Cuda 9, CUDNN, OpenCV 3.3. My solution to run Yolov3 perfectly was to : modify the cfg/yolov3.cfg :
|
That's worked for me! Thank you very much! |
Your solution works on me, thank you very much!!!! |
does the weight and height inference the result? |
That's a good question, i guess not! |
Here https://github.com/AlexeyAB/darknet you can find this note: |
It works!thank you so much ! |
Thanks. works)) |
Another solution that worked for me was to use one of the alternate config files: yolov3-tiny.cfg. You'll notice that @aryus96 options is what is used in that file as well:
So instead of using the command
I use
I can also use yolov3-openimages.cfg, yolov3-spp.cfg, and yolov3-voc.cfg without errors. |
Hi, |
To not get an OOM during prediction, I had to set
on my Quadro M1200 with 4GB of RAM. |
Not working , it show : |
@abdou31 I think most of the comments inthis issue are about inference, not training. |
this worked in my nvidia GT940M |
@zenogantner but what about training? |
It worked!! finally i am able to train my dataset!!! i thought of nvidia drivers installed already..in my laptop by default..!! |
When uncommenting batch=1 and subdivisions=1 i got it working with a detection time of 2.9 seconds.
But by undoing the changes and just increasing the subdivisions from 16 to 32 i got a detection time of 0.2 seconds Running RTX 2060 with nvidia-418 and cuda 10.1 Edit: |
I'm using a Nvidia GT 1030 (2gb memory), getting a prediction time of 0.162808 seconds with these settings: batch=32 I have not found a settings combination to run width and height of 608, I see this error: 74 res 71 19 x 19 x1024 -> 19 x 19 x1024 Looking at nvidia-smi, it seems like it "only just" runs out of memory trying with 608, if there was an extra 500mb memory on the card I suspect it would work. :( |
I did what he said, and then it succeeded. |
I found the variable batch in the file cfg/yolov3.cfg with value 40, when I changed to 1 it produced an error saing "0 cuda nalloc failed". |
I was using 2080Ti & It showed me this error. So I went through some stackoverflow links. Remove Nvidia's outdated driver(if you followed some blog post to install driver and cuda) Download latest drivers manually from official website. You are good to go....error fixed 🎉🎉🎉 |
hello. I have latest Nvidia drivers and GTX 1050, nvidia-smi shows that I have 4GB GPU memory: |
Tengo una GT 740M de 2GB y funciono con yoloV3-tiny, tanto en la configuracion como los pesos. |
Thanks @aryus96 . I have this problem in another way. I explained my problem in Darknet docker image doesnt work after shipping to another system #4082."
As you mentioned, I guess second problem rises from lower GPU memory. Are you have any idea about my first problem(detection in one but could not detect in another)? |
I Training YOLO on VOC according to the introduction from https://pjreddie.com/darknet/yolo/#train-voc
I also have a mistake
Both error has disappered.
|
Hi, I used a GPU Nvidia 840M with 2GB memory, and met the same problem. I also tried increasing the batch and subdivision( they need to be the same, or there would be problem) in the .cfg file, it didn't work, even turned them up to 1024. |
Beers and cheers for this guy! It works! |
Just a hypothesis: having subdivisions / batch == 16 resolves the out of memory issue... somehow... |
This might work for some as (possibly) your previous failed runs are still occupying some memory, a similar approach would be to kill all python processes. |
Tried reboot device and modify yolo config file. still i am getting issue. Any help appreciated ! batch=1 batch=1 Error log : |
I have the following:
... In fact, after struggling for 2 days, just came up with this combination of params in the yolov4-custom.cfg and started to train about an hour ago. Keeping my fingers crossed, but definitely the hurdle of unable to load Forward Convultional layer or the infamous Error: cuDNN isn't found FWD algo for convolution is not appearing anymore. Its running past all that and training and I do see a set of weights saved. |
Hi,
I maked the darknet with "GPU=1,CUDNN=1,OPENCV=1" successfully,however,when I use the command "sudo ./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/dog.jpg
",it shows:
CUDA Error: out of memory
darknet: ./src/cuda.c:36: check_error: Assertion `0' failed.
But if I use the command"sudo ./darknet detector test cfg/coco.data cfg/yolov2.cfg yolov2.weights data/dog.jpg",it can detect targets successfully.
It seems that the problem is the yolov3.What can I do to solve the problem?
The text was updated successfully, but these errors were encountered: