Skip to content
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

CUDA status Error: file: ./src/dark_cuda.c : () : line: 239 : build time: Apr 16 2020 - 16:43:48 CUDA Error: invalid argument: File exists darknet: ./src/utils.c:325: error: Assertion `0' failed. #2117

Open
SK124 opened this issue Apr 17, 2020 · 8 comments

Comments

@SK124
Copy link

SK124 commented Apr 17, 2020

Hello Guys! I'm trying to train YOLOv3 on a custom dataset on Google Colab and I'm running into this error whenever I give the train command

!./darknet detector train data/obj.data yolo-obj.cfg darknet53.conv.74 -dont_show

OUTPUT is as follows:

CUDA-version: 10010 (10010), GPU count: 1
OpenCV version: 3.2.0
yolo-obj
compute_capability = 370, cudnn_half = 0
net.optimized_memory = 0
mini_batch = 1, batch = 64, time_steps = 1, train = 1
layer filters size/strd(dil) input output
0 conv 32 3 x 3/ 1 416 x 416 x 3 -> 416 x 416 x 32 0.299 BF
1 conv 64 3 x 3/ 2 416 x 416 x 32 -> 208 x 208 x 64 1.595 BF
2 conv 32 1 x 1/ 1 208 x 208 x 64 -> 208 x 208 x 32 0.177 BF
3 conv 64 3 x 3/ 1 208 x 208 x 32 -> 208 x 208 x 64 1.595 BF
4 Shortcut Layer: 1, wt = 0, wn = 0, outputs: 208 x 208 x 64 0.003 BF
5 conv 128 3 x 3/ 2 208 x 208 x 64 -> 104 x 104 x 128 1.595 BF
6 conv 64 1 x 1/ 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BF
7 conv 128 3 x 3/ 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF
8 Shortcut Layer: 5, wt = 0, wn = 0, outputs: 104 x 104 x 128 0.001 BF
9 conv 64 1 x 1/ 1 104 x 104 x 128 -> 104 x 104 x 64 0.177 BF
10 conv 128 3 x 3/ 1 104 x 104 x 64 -> 104 x 104 x 128 1.595 BF
11 Shortcut Layer: 8, wt = 0, wn = 0, outputs: 104 x 104 x 128 0.001 BF
12 conv 256 3 x 3/ 2 104 x 104 x 128 -> 52 x 52 x 256 1.595 BF
13 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
14 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
15 Shortcut Layer: 12, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
16 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
17 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
18 Shortcut Layer: 15, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
19 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
20 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
21 Shortcut Layer: 18, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
22 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
23 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
24 Shortcut Layer: 21, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
25 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
26 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
27 Shortcut Layer: 24, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
28 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
29 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
30 Shortcut Layer: 27, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
31 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
32 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
33 Shortcut Layer: 30, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
34 conv 128 1 x 1/ 1 52 x 52 x 256 -> 52 x 52 x 128 0.177 BF
35 conv 256 3 x 3/ 1 52 x 52 x 128 -> 52 x 52 x 256 1.595 BF
36 Shortcut Layer: 33, wt = 0, wn = 0, outputs: 52 x 52 x 256 0.001 BF
37 conv 512 3 x 3/ 2 52 x 52 x 256 -> 26 x 26 x 512 1.595 BF
38 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF
39 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF
40 Shortcut Layer: 37, wt = 0, wn = 0, outputs: 26 x 26 x 512 0.000 BF
41 conv 256 1 x 1/ 1 26 x 26 x 512 -> 26 x 26 x 256 0.177 BF
42 conv 512 3 x 3/ 1 26 x 26 x 256 -> 26 x 26 x 512 1.595 BF
Allocate additional workspace_size = 49.84 MB
Loading weights from darknet53.conv.74...
seen 64, trained: 0 K-images (0 Kilo-batches_64)
Done! Loaded 75 layers from weights-file
Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005
Resizing, random_coef = 1.40

608 x 608
try to allocate additional workspace_size = 106.46 MB
CUDA allocate done!
Loaded: 0.000055 seconds
CUDA status Error: file: ./src/dark_cuda.c : () : line: 239 : build time: Apr 16 2020 - 16:43:48
CUDA Error: invalid argument
CUDA Error: invalid argument: File exists
darknet: ./src/utils.c:325: error: Assertion `0' failed.

My Makefile
GPU=1
CUDNN=1
CUDNN_HALF=0
OPENCV=1
AVX=0
OPENMP=0
LIBSO=0
ZED_CAMERA=0 # ZED SDK 3.0 and above
ZED_CAMERA_v2_8=0 # ZED SDK 2.X
USE_CPP=0
DEBUG=0

ARCH= -gencode arch=compute_30, code=sm_30
-gencode arch=compute_37, code=sm_37
-gencode arch=compute_50,code=[sm_50,compute_50]
-gencode arch=compute_52,code=[sm_52,compute_52]
-gencode arch=compute_61,code=[sm_61,compute_61]\

Dataset Used: BDD100K
It seems more like a CUDA Driver Issue to me
CUDA-version: 10010 (10010) is given as output in colab cell but when I try !/usr/local/cuda/bin/nvcc --version

OUTPUT is as follows:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
##I have attached my dark_cuda.c, utils.c along with yolo-obj.cfg ##
utils_and_darkcuda_files.zip
Any help is highly appreciated

@SK124 SK124 changed the title CUDA status Error: file: ./src/dark_cuda.c : () : line: 239 : build time: Apr 16 2020 - 16:43:48 CUDA status Error: file: ./src/dark_cuda.c : () : line: 239 : build time: Apr 16 2020 - 16:43:48 Apr 17, 2020
@SK124 SK124 changed the title CUDA status Error: file: ./src/dark_cuda.c : () : line: 239 : build time: Apr 16 2020 - 16:43:48 CUDA status Error: file: ./src/dark_cuda.c : () : line: 239 : build time: Apr 16 2020 - 16:43:48 CUDA Error: invalid argument: File exists darknet: ./src/utils.c:325: error: Assertion `0' failed. Apr 17, 2020
@kir486680
Copy link

i have the same issue on colab

@kir486680
Copy link

@SK124 I solved that issue by downloading darknet like that

!ls
!cd /content
!rm -fr darknet
!git clone https://github.com/AlexeyAB/darknet/
% cd darknet
!sed -i 's/OPENCV=0/OPENCV=1/g' Makefile
!sed -i 's/GPU=0/GPU=1/g' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/g' Makefile
!apt update
!apt-get install libopencv-dev

@Partha-Sarker
Copy link

@SK124 I solved that issue by downloading darknet like that

!ls
!cd /content
!rm -fr darknet
!git clone https://github.com/AlexeyAB/darknet/
% cd darknet
!sed -i 's/OPENCV=0/OPENCV=1/g' Makefile
!sed -i 's/GPU=0/GPU=1/g' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/g' Makefile
!apt update
!apt-get install libopencv-dev

that worked for me

@sba17
Copy link

sba17 commented Feb 24, 2021

updated subdivision as 64 and resolved the issue.

@Janani130399
Copy link

If you are using Google colab. Then check your GPU settings in colab.

@ashishaassi21
Copy link

I did this but then I started getting this error
/bin/bash: .cd/content/darknet: No such file or directory

AttributeError Traceback (most recent call last)

@kaushik-bhatt
Copy link

I tried so many things. Also, tried dos2unix(), turned to ubuntu, but getting same error. After that I tried this, which really solved my problem.

!git clone https://github.com/AlexeyAB/darknet/
% cd darknet
!sed -i 's/OPENCV=0/OPENCV=1/g' Makefile
!sed -i 's/GPU=0/GPU=1/g' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/g' Makefile
!apt update
!apt-get install libopencv-dev

There is nothing wrong with files copied from windows or linux, problem exist for the the darknet version cloned from:

!git clone 'https://github.com/pjreddie/darknet'

changed it.

@lyiqian
Copy link

lyiqian commented Nov 30, 2021

I had the same error except it didn't have the last line (darknet: ./src/utils.c:325: error: Assertion '0' failed.)

My fix was to remove max=100 under [yolo] in the config file, doc

Given above sba17 mentioned the subdivisions fix, you might want to check any newly changed configs in your case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants