0% found this document useful (0 votes)
200 views42 pages

Yolo v4

YOLO v4 addresses the issue of training an object detector on a single GPU with a smaller mini-batch size, making it possible to train a super fast and accurate object detector with a single GPU. The document then discusses cloning the darknet repository and building darknet to be able to run and train object detectors.

Uploaded by

Deepak Saxena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
200 views42 pages

Yolo v4

YOLO v4 addresses the issue of training an object detector on a single GPU with a smaller mini-batch size, making it possible to train a super fast and accurate object detector with a single GPU. The document then discusses cloning the darknet repository and building darknet to be able to run and train object detectors.

Uploaded by

Deepak Saxena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

yolo v4

November 7, 2020

1 YOLOv4
YOLO v4 addresses this issue by making an object detector which can be trained on a single GPU
with a smaller mini-batch size. This makes it possible to train a super fast and accurate object
detector with a single 1080 Ti or 2080 Ti GPU.

1.0.1 Cloning and Building Darknet

[ ]: # clone darknet repo


!git clone https://github.com/AlexeyAB/darknet

[ ]: # change makefile to have GPU and OPENCV enabled


%cd darknet
!sed -i 's/OPENCV=0/OPENCV=1/' Makefile
!sed -i 's/GPU=0/GPU=1/' Makefile
!sed -i 's/CUDNN=0/CUDNN=1/' Makefile
!sed -i 's/CUDNN_HALF=0/CUDNN_HALF=1/' Makefile

[3]: # verify CUDA


!/usr/local/cuda/bin/nvcc --version

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

[4]: # make darknet (builds darknet so that you can then use the darknet executable␣
,→file to run or train object detectors)

!make

mkdir -p ./obj/
mkdir -p backup
chmod +x *.sh
g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config
--cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU
-I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-
unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN
-I/usr/local/cudnn/include -DCUDNN_HALF -c ./src/image_opencv.cpp -o

1
obj/image_opencv.o
./src/image_opencv.cpp: In function ‘void
draw_detections_cv_v3(void**, detection*, int, float, char**, image**, int,
int)’:
./src/image_opencv.cpp:926:23: warning: variable
‘rgb’ set but not used [-Wunused-but-set-
variable]
float rgb[3];
^~~
./src/image_opencv.cpp: In function ‘void
draw_train_loss(char*, void**, int, float, float, int, int, float, int, char*,
float, int, int, double)’:
./src/image_opencv.cpp:1127:13: warning: this
‘if’ clause does not guard… [-Wmisleading-
indentation]
if (iteration_old == 0)
^~
./src/image_opencv.cpp:1130:10: note: …this
statement, but the latter is misleadingly indented as if it were guarded by the
‘if’
if (iteration_old != 0){
^~
./src/image_opencv.cpp: In function ‘void
cv_draw_object(image, float*, int, int, int*, float*, int*, int, char**)’:
./src/image_opencv.cpp:1424:14: warning: unused
variable ‘buff’ [-Wunused-variable]
char buff[100];
^~~~
./src/image_opencv.cpp:1400:9: warning: unused
variable ‘it_tb_res’ [-Wunused-variable]
int it_tb_res = cv::createTrackbar(it_trackbar_name,
window_name, &it_trackbar_value, 1000);
^~~~~~~~~
./src/image_opencv.cpp:1404:9: warning: unused
variable ‘lr_tb_res’ [-Wunused-variable]
int lr_tb_res = cv::createTrackbar(lr_trackbar_name,
window_name, &lr_trackbar_value, 20);
^~~~~~~~~
./src/image_opencv.cpp:1408:9: warning: unused
variable ‘cl_tb_res’ [-Wunused-variable]
int cl_tb_res = cv::createTrackbar(cl_trackbar_name,
window_name, &cl_trackbar_value, classes-1);
^~~~~~~~~
./src/image_opencv.cpp:1411:9: warning: unused

2
variable ‘bo_tb_res’ [-Wunused-variable]
int bo_tb_res = cv::createTrackbar(bo_trackbar_name,
window_name, boxonly, 1);
^~~~~~~~~
g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config
--cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU
-I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-
unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN
-I/usr/local/cudnn/include -DCUDNN_HALF -c ./src/http_stream.cpp -o
obj/http_stream.o
In file included from ./src/http_stream.cpp:580:0:
./src/httplib.h:129:0: warning: "INVALID_SOCKET"
redefined
#define INVALID_SOCKET (-1)

./src/http_stream.cpp:73:0: note: this is the


location of the previous definition
#define INVALID_SOCKET -1

./src/http_stream.cpp: In member function ‘bool


JSON_sender::write(const char*)’:
./src/http_stream.cpp:249:21: warning: unused
variable ‘n’ [-Wunused-variable]
int n = _write(client, outputbuf, outlen);
^
./src/http_stream.cpp: In member function ‘bool
MJPG_sender::write(const cv::Mat&)’:
./src/http_stream.cpp:507:113: warning: format
‘%zu’ expects argument of type ‘size_t’, but
argument 3 has type ‘int’ [-Wformat=]
sprintf(head, "--mjpegstream\r\nContent-Type:
image/jpeg\r\nContent-Length: %zu\r\n\r\n", outlen);
^
./src/http_stream.cpp: In function ‘void
set_track_id(detection*, int, float, float, float, int, int, int)’:
./src/http_stream.cpp:863:27: warning: comparison
between signed and unsigned integer expressions [-Wsign-
compare]
for (int i = 0; i < v.size(); ++i) {
~~^~~~~~~~~~
./src/http_stream.cpp:871:33: warning: comparison
between signed and unsigned integer expressions [-Wsign-
compare]
for (int old_id = 0; old_id < old_dets.size(); ++old_id) {
~~~~~~~^~~~~~~~~~~~~~~~~

3
./src/http_stream.cpp:890:31: warning: comparison
between signed and unsigned integer expressions [-Wsign-
compare]
for (int index = 0; index < new_dets_num*old_dets.size();
++index) {
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/http_stream.cpp:926:28: warning: comparison
between signed and unsigned integer expressions [-Wsign-
compare]
if (old_dets_dq.size() > deque_size)
old_dets_dq.pop_front();
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/gemm.c -o obj/gemm.o
./src/gemm.c: In function ‘convolution_2d’:
./src/gemm.c:2038:15: warning: unused variable
‘out_w’ [-Wunused-variable]
const int out_w = (w + 2 * pad - ksize) / stride + 1;
// output_width=input_width for stride=1 and pad=1
^~~~~
./src/gemm.c:2037:15: warning: unused variable
‘out_h’ [-Wunused-variable]
const int out_h = (h + 2 * pad - ksize) / stride + 1;
// output_height=input_height for stride=1 and pad=1
^~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/utils.c -o obj/utils.o
./src/utils.c: In function ‘custom_hash’:
./src/utils.c:1039:12: warning: suggest
parentheses around assignment used as truth value
[-Wparentheses]
while (c = *str++)
^
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/dark_cuda.c -o obj/dark_cuda.o
./src/dark_cuda.c: In function
‘cudnn_check_error_extended’:

4
./src/dark_cuda.c:224:20: warning: comparison
between ‘cudaError_t {aka enum cudaError}’ and ‘enum
<anonymous>’ [-Wenum-compare]
if (status != CUDNN_STATUS_SUCCESS)
^~
./src/dark_cuda.c: In function
‘pre_allocate_pinned_memory’:
./src/dark_cuda.c:276:40: warning: format
‘%u’ expects argument of type ‘unsigned int’, but
argument 2 has type ‘long unsigned int’
[-Wformat=]
printf("pre_allocate: size = %Iu MB, num_of_blocks =
%Iu, block_size = %Iu MB \n",
~~^
%Ilu
size / (1024*1024), num_of_blocks, pinned_block_size
/ (1024 * 1024));
~~~~~~~~~~~~~~~~~~
./src/dark_cuda.c:276:64: warning: format
‘%u’ expects argument of type ‘unsigned int’, but
argument 3 has type ‘size_t {aka const long unsigned int}’
[-Wformat=]
printf("pre_allocate: size = %Iu MB, num_of_blocks =
%Iu, block_size = %Iu MB \n",
~~^
%Ilu
./src/dark_cuda.c:276:82: warning: format
‘%u’ expects argument of type ‘unsigned int’, but
argument 4 has type ‘long unsigned int’
[-Wformat=]
printf("pre_allocate: size = %Iu MB, num_of_blocks = %Iu, block_size =
%Iu MB \n",
~~^
%Ilu
./src/dark_cuda.c:286:37: warning: format
‘%d’ expects argument of type ‘int’, but argument 2
has type ‘size_t {aka const long unsigned int}’
[-Wformat=]
printf(" Allocated %d pinned block \n",
pinned_block_size);
~^
%ld
./src/dark_cuda.c: In function
‘cuda_make_array_pinned_preallocated’:
./src/dark_cuda.c:307:43: warning: format
‘%d’ expects argument of type ‘int’, but argument 2
has type ‘size_t {aka long unsigned int}’

5
[-Wformat=]
printf("\n Pinned block_id = %d, filled = %f %%
\n", pinned_block_id, filled);
~^
%ld
./src/dark_cuda.c:322:64: warning: format
‘%d’ expects argument of type ‘int’, but argument 2
has type ‘long unsigned int’ [-Wformat=]
printf("Try to allocate new pinned memory, size =
%d MB \n", size / (1024 * 1024));
~^ ~~~~~~~~~~~~~~~~~~~~
%ld
./src/dark_cuda.c:328:63: warning: format
‘%d’ expects argument of type ‘int’, but argument 2
has type ‘long unsigned int’ [-Wformat=]
printf("Try to allocate new pinned BLOCK, size =
%d MB \n", size / (1024 * 1024));
~^ ~~~~~~~~~~~~~~~~~~~~
%ld
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/convolutional_layer.c -o obj/convolutional_layer.o
./src/convolutional_layer.c: In function
‘forward_convolutional_layer’:
./src/convolutional_layer.c:1337:32: warning:
unused variable ‘t_intput_size’ [-Wunused-
variable]
size_t t_intput_size =
binary_transpose_align_input(k, n, state.workspace, &l.t_bit_input, ldb_align,
l.bit_align);
^~~~~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/list.c -o obj/list.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/image.c -o obj/image.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-

6
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/activations.c -o obj/activations.o
./src/activations.c: In function ‘activate’:
./src/activations.c:79:5: warning: enumeration
value ‘RELU6’ not handled in switch [-Wswitch]
switch(a){
^~~~~~
./src/activations.c:79:5: warning: enumeration
value ‘SWISH’ not handled in switch [-Wswitch]
./src/activations.c:79:5: warning: enumeration
value ‘MISH’ not handled in switch [-Wswitch]
./src/activations.c:79:5: warning: enumeration
value ‘HARD_MISH’ not handled in switch
[-Wswitch]
./src/activations.c:79:5: warning: enumeration
value ‘NORM_CHAN’ not handled in switch
[-Wswitch]
./src/activations.c:79:5: warning: enumeration
value ‘NORM_CHAN_SOFTMAX’ not handled in switch
[-Wswitch]
./src/activations.c:79:5: warning: enumeration
value ‘NORM_CHAN_SOFTMAX_MAXVAL’ not handled in switch
[-Wswitch]
./src/activations.c: In function ‘gradient’:
./src/activations.c:310:5: warning: enumeration
value ‘SWISH’ not handled in switch [-Wswitch]
switch(a){
^~~~~~
./src/activations.c:310:5: warning: enumeration
value ‘MISH’ not handled in switch [-Wswitch]
./src/activations.c:310:5: warning: enumeration
value ‘HARD_MISH’ not handled in switch
[-Wswitch]
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/im2col.c -o obj/im2col.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/col2im.c -o obj/col2im.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/blas.c -o obj/blas.o

7
./src/blas.c: In function
‘backward_shortcut_multilayer_cpu’:
./src/blas.c:207:21: warning: unused variable
‘out_index’ [-Wunused-variable]
int out_index = id;
^~~~~~~~~
./src/blas.c: In function ‘find_sim’:
./src/blas.c:597:59: warning: format
‘%d’ expects argument of type ‘int’, but argument 2
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
printf(" Error: find_sim(): sim isn't found: i = %d, j
= %d, z = %d \n", i, j, z);
~^
%ld
./src/blas.c:597:67: warning: format
‘%d’ expects argument of type ‘int’, but argument 3
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
printf(" Error: find_sim(): sim isn't found: i = %d, j =
%d, z = %d \n", i, j, z);
~^
%ld
./src/blas.c:597:75: warning: format
‘%d’ expects argument of type ‘int’, but argument 4
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
printf(" Error: find_sim(): sim isn't found: i = %d, j = %d, z =
%d \n", i, j, z);
~^
%ld
./src/blas.c: In function ‘find_P_constrastive’:
./src/blas.c:611:68: warning: format
‘%d’ expects argument of type ‘int’, but argument 2
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
printf(" Error: find_P_constrastive(): P isn't found: i =
%d, j = %d, z = %d \n", i, j, z);
~^
%ld
./src/blas.c:611:76: warning: format
‘%d’ expects argument of type ‘int’, but argument 3
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
printf(" Error: find_P_constrastive(): P isn't found: i = %d, j =
%d, z = %d \n", i, j, z);
~^
%ld

8
./src/blas.c:611:84: warning: format
‘%d’ expects argument of type ‘int’, but argument 4
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
printf(" Error: find_P_constrastive(): P isn't found: i = %d, j = %d, z
= %d \n", i, j, z);
~^
%ld
./src/blas.c: In function ‘P_constrastive_f’:
./src/blas.c:651:79: warning: format
‘%d’ expects argument of type ‘int’, but argument 3
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
fprintf(stderr, " Error: in P_constrastive must be i != l, while i =
%d, l = %d \n", i, l);
~^
%ld
./src/blas.c:651:87: warning: format
‘%d’ expects argument of type ‘int’, but argument 4
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
fprintf(stderr, " Error: in P_constrastive must be i != l, while i =
%d, l = %d \n", i, l);
~^
%ld
./src/blas.c: In function ‘P_constrastive’:
./src/blas.c:785:79: warning: format
‘%d’ expects argument of type ‘int’, but argument 3
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
fprintf(stderr, " Error: in P_constrastive must be i != l, while i =
%d, l = %d \n", i, l);
~^
%ld
./src/blas.c:785:87: warning: format
‘%d’ expects argument of type ‘int’, but argument 4
has type ‘size_t {aka long unsigned int}’
[-Wformat=]
fprintf(stderr, " Error: in P_constrastive must be i != l, while i =
%d, l = %d \n", i, l);
~^
%ld
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/crop_layer.c -o obj/crop_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>

9
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/dropout_layer.c -o obj/dropout_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/maxpool_layer.c -o obj/maxpool_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/softmax_layer.c -o obj/softmax_layer.o
./src/softmax_layer.c: In function
‘make_contrastive_layer’:
./src/softmax_layer.c:203:101: warning: format
‘%d’ expects argument of type ‘int’, but argument 9
has type ‘size_t {aka const long unsigned int}’
[-Wformat=]
fprintf(stderr, "contrastive %4d x%4d x%4d x emb_size %4d x batch: %4d
classes = %4d, step = %4d \n", w, h, l.n, l.embedding_size,
batch, l.classes, step);
~~^
%4ld
./src/softmax_layer.c: In function
‘forward_contrastive_layer’:
./src/softmax_layer.c:244:27: warning: variable
‘max_truth’ set but not used [-Wunused-but-set-
variable]
float max_truth = 0;
^~~~~~~~~
./src/softmax_layer.c:423:71: warning: format
‘%d’ expects argument of type ‘int’, but argument 2
has type ‘size_t {aka const long unsigned int}’
[-Wformat=]
printf(" Error: too large number of bboxes: contr_size =
%d > max_contr_size = %d \n", contr_size, max_contr_size);
~^
%ld
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/data.c -o obj/data.o
./src/data.c: In function ‘load_data_detection’:
./src/data.c:1297:24: warning: unused variable

10
‘x’ [-Wunused-variable]
int k, x, y;
^
./src/data.c:1090:43: warning: variable
‘r_scale’ set but not used [-Wunused-but-set-
variable]
float r1 = 0, r2 = 0, r3 = 0, r4 = 0, r_scale = 0;
^~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/matrix.c -o obj/matrix.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/network.c -o obj/network.o
./src/network.c: In function ‘resize_network’:
./src/network.c:615:42: warning: passing argument
1 of ‘cudaHostAlloc’ from incompatible pointer type
[-Wincompatible-pointer-types]
if (cudaSuccess ==
cudaHostAlloc(&net->input_pinned_cpu, size * sizeof(float),
cudaHostRegisterMapped))
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/network.c:1:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/connected_layer.c -o obj/connected_layer.o
./src/connected_layer.c: In function
‘forward_connected_layer_gpu’:
./src/connected_layer.c:346:11: warning: unused
variable ‘one’ [-Wunused-variable]
float one = 1; // alpha[0], beta[0]
^~~
./src/connected_layer.c:344:13: warning: unused

11
variable ‘c’ [-Wunused-variable]
float * c = l.output_gpu;
^
./src/connected_layer.c:343:13: warning: unused
variable ‘b’ [-Wunused-variable]
float * b = l.weights_gpu;
^
./src/connected_layer.c:342:13: warning: unused
variable ‘a’ [-Wunused-variable]
float * a = state.input;
^
./src/connected_layer.c:341:9: warning: unused
variable ‘n’ [-Wunused-variable]
int n = l.outputs;
^
./src/connected_layer.c:340:9: warning: unused
variable ‘k’ [-Wunused-variable]
int k = l.inputs;
^
./src/connected_layer.c:339:9: warning: unused
variable ‘m’ [-Wunused-variable]
int m = l.batch;
^
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/cost_layer.c -o obj/cost_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/parser.c -o obj/parser.o
./src/parser.c: In function
‘parse_network_cfg_custom’:
./src/parser.c:1669:42: warning: passing argument
1 of ‘cudaHostAlloc’ from incompatible pointer type
[-Wincompatible-pointer-types]
if (cudaSuccess ==
cudaHostAlloc(&net.input_pinned_cpu, size * sizeof(float),
cudaHostRegisterMapped)) net.input_pinned_cpu_flag = 1;
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/activations.h:3,
from ./src/activation_layer.h:4,
from ./src/parser.c:6:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:

12
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
./src/parser.c: In function
‘get_classes_multipliers’:
./src/parser.c:428:29: warning: argument 1 range
[18446744071562067968, 18446744073709551615] exceeds maximum object size
9223372036854775807 [-Walloc-size-larger-than=]
classes_multipliers = (float *)calloc(classes_counters,
sizeof(float));
~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~
In file included from ./src/parser.c:3:0:
/usr/include/stdlib.h:541:14: note: in a call to
allocation function ‘calloc’ declared here
extern void *calloc (size_t __nmemb, size_t __size)
^~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/option_list.c -o obj/option_list.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/darknet.c -o obj/darknet.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/detection_layer.c -o obj/detection_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/captcha.c -o obj/captcha.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/route_layer.c -o obj/route_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/

13
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/writing.c -o obj/writing.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/box.c -o obj/box.o
./src/box.c: In function ‘box_iou_kind’:
./src/box.c:154:5: warning: enumeration value
‘MSE’ not handled in switch [-Wswitch]
switch(iou_kind) {
^~~~~~
./src/box.c: In function ‘diounms_sort’:
./src/box.c:898:27: warning: unused variable
‘beta_prob’ [-Wunused-variable]
float beta_prob = pow(dets[j].prob[k], 2)
/ sum_prob;
^~~~~~~~~
./src/box.c:897:27: warning: unused variable
‘alpha_prob’ [-Wunused-variable]
float alpha_prob = pow(dets[i].prob[k], 2)
/ sum_prob;
^~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/nightmare.c -o obj/nightmare.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/normalization_layer.c -o obj/normalization_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/avgpool_layer.c -o obj/avgpool_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/coco.c -o obj/coco.o
./src/coco.c: In function ‘validate_coco_recall’:
./src/coco.c:248:11: warning: unused variable
‘base’ [-Wunused-variable]
char *base = "results/comp4_det_test_";

14
^~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/dice.c -o obj/dice.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/yolo.c -o obj/yolo.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/detector.c -o obj/detector.o
./src/detector.c: In function ‘print_cocos’:
./src/detector.c:478:29: warning: format not a
string literal and no format arguments [-Wformat-security]
fprintf(fp, buff);
^~~~
./src/detector.c: In function ‘eliminate_bdd’:
./src/detector.c:571:21: warning: statement with
no effect [-Wunused-value]
for (k; buf[k + n] != '\0'; k++)
^~~
./src/detector.c: In function ‘validate_detector’:
./src/detector.c:692:13: warning: unused variable
‘mkd2’ [-Wunused-variable]
int mkd2 = make_directory(buff2, 0777);
^~~~
./src/detector.c:690:13: warning: unused variable
‘mkd’ [-Wunused-variable]
int mkd = make_directory(buff, 0777);
^~~
./src/detector.c: In function
‘validate_detector_map’:
./src/detector.c:1323:15: warning: unused
variable ‘class_recall’ [-Wunused-variable]
float class_recall = (float)tp_for_thresh_per_class[i]
/ ((float)tp_for_thresh_per_class[i] + (float)(truth_classes_count[i] -
tp_for_thresh_per_class[i]));
^~~~~~~~~~~~
./src/detector.c:1322:15: warning: unused
variable ‘class_precision’ [-Wunused-variable]
float class_precision =
(float)tp_for_thresh_per_class[i] / ((float)tp_for_thresh_per_class[i] +
(float)fp_for_thresh_per_class[i]);

15
^~~~~~~~~~~~~~~
./src/detector.c: In function ‘draw_object’:
./src/detector.c:1857:19: warning: unused
variable ‘inv_loss’ [-Wunused-variable]
float inv_loss = 1.0 / max_val_cmp(0.01,
avg_loss);
^~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/layer.c -o obj/layer.o
./src/layer.c: In function ‘free_layer_custom’:
./src/layer.c:205:68: warning: suggest
parentheses around ‘&&’ within ‘||’
[-Wparentheses]
if (l.delta_gpu && (l.optimized_memory < 1 || l.keep_delta_gpu
&& l.optimized_memory < 3)) cuda_free(l.delta_gpu), l.delta_gpu = NULL;
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/compare.c -o obj/compare.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/classifier.c -o obj/classifier.o
./src/classifier.c: In function ‘train_classifier’:
./src/classifier.c:146:9: warning: unused
variable ‘count’ [-Wunused-variable]
int count = 0;
^~~~~
./src/classifier.c: In function
‘predict_classifier’:
./src/classifier.c:855:13: warning: unused
variable ‘time’ [-Wunused-variable]
clock_t time;
^~~~
./src/classifier.c: In function ‘demo_classifier’:
./src/classifier.c:1287:49: warning: unused
variable ‘tval_result’ [-Wunused-variable]
struct timeval tval_before, tval_after, tval_result;
^~~~~~~~~~~
./src/classifier.c:1287:37: warning: unused
variable ‘tval_after’ [-Wunused-variable]

16
struct timeval tval_before, tval_after, tval_result;
^~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/local_layer.c -o obj/local_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/swag.c -o obj/swag.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/shortcut_layer.c -o obj/shortcut_layer.o
./src/shortcut_layer.c: In function
‘make_shortcut_layer’:
./src/shortcut_layer.c:55:15: warning: unused
variable ‘scale’ [-Wunused-variable]
float scale = sqrt(2. / l.nweights);
^~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/activation_layer.c -o obj/activation_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/rnn_layer.c -o obj/rnn_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/gru_layer.c -o obj/gru_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/rnn.c -o obj/rnn.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/rnn_vid.c -o obj/rnn_vid.o

17
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/crnn_layer.c -o obj/crnn_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/demo.c -o obj/demo.o
./src/demo.c: In function ‘detect_in_thread’:
./src/demo.c:100:16: warning: unused variable
‘prediction’ [-Wunused-variable]
float *prediction = network_predict(net, X);
^~~~~~~~~~
./src/demo.c:98:15: warning: unused variable
‘l’ [-Wunused-variable]
layer l = net.layers[net.n - 1];
^
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/tag.c -o obj/tag.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/cifar.c -o obj/cifar.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/go.c -o obj/go.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/batchnorm_layer.c -o obj/batchnorm_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/art.c -o obj/art.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include

18
-DCUDNN_HALF -c ./src/region_layer.c -o obj/region_layer.o
./src/region_layer.c: In function
‘resize_region_layer’:
./src/region_layer.c:59:9: warning: unused
variable ‘old_h’ [-Wunused-variable]
int old_h = l->h;
^~~~~
./src/region_layer.c:58:9: warning: unused
variable ‘old_w’ [-Wunused-variable]
int old_w = l->w;
^~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/reorg_layer.c -o obj/reorg_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/reorg_old_layer.c -o obj/reorg_old_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/super.c -o obj/super.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/voxel.c -o obj/voxel.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/tree.c -o obj/tree.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/yolo_layer.c -o obj/yolo_layer.o
./src/yolo_layer.c: In function ‘make_yolo_layer’:
./src/yolo_layer.c:68:38: warning: passing
argument 1 of ‘cudaHostAlloc’ from incompatible pointer type
[-Wincompatible-pointer-types]
if (cudaSuccess == cudaHostAlloc(&l.output,
batch*l.outputs*sizeof(float), cudaHostRegisterMapped)) l.output_pinned = 1;
^

19
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/activations.h:3,
from ./src/layer.h:4,
from ./src/yolo_layer.h:5,
from ./src/yolo_layer.c:1:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
./src/yolo_layer.c:75:38: warning: passing
argument 1 of ‘cudaHostAlloc’ from incompatible pointer type
[-Wincompatible-pointer-types]
if (cudaSuccess == cudaHostAlloc(&l.delta,
batch*l.outputs*sizeof(float), cudaHostRegisterMapped)) l.delta_pinned = 1;
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/activations.h:3,
from ./src/layer.h:4,
from ./src/yolo_layer.h:5,
from ./src/yolo_layer.c:1:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
./src/yolo_layer.c: In function ‘resize_yolo_layer’:
./src/yolo_layer.c:106:42: warning: passing
argument 1 of ‘cudaHostAlloc’ from incompatible pointer type
[-Wincompatible-pointer-types]
if (cudaSuccess != cudaHostAlloc(&l->output,
l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) {
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/activations.h:3,
from ./src/layer.h:4,
from ./src/yolo_layer.h:5,
from ./src/yolo_layer.c:1:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);

20
^~~~~~~~~~~~~
./src/yolo_layer.c:115:42: warning: passing
argument 1 of ‘cudaHostAlloc’ from incompatible pointer type
[-Wincompatible-pointer-types]
if (cudaSuccess != cudaHostAlloc(&l->delta,
l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) {
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/activations.h:3,
from ./src/layer.h:4,
from ./src/yolo_layer.h:5,
from ./src/yolo_layer.c:1:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
./src/yolo_layer.c: In function
‘forward_yolo_layer’:
./src/yolo_layer.c:394:25: warning: variable
‘best_match_t’ set but not used [-Wunused-but-set-
variable]
int best_match_t = 0;
^~~~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/gaussian_yolo_layer.c -o obj/gaussian_yolo_layer.o
./src/gaussian_yolo_layer.c: In function
‘make_gaussian_yolo_layer’:
./src/gaussian_yolo_layer.c:71:38: warning:
passing argument 1 of ‘cudaHostAlloc’ from incompatible
pointer type [-Wincompatible-pointer-types]
if (cudaSuccess == cudaHostAlloc(&l.output,
batch*l.outputs * sizeof(float), cudaHostRegisterMapped)) l.output_pinned = 1;
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/gaussian_yolo_layer.h:5,
from ./src/gaussian_yolo_layer.c:7:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’

21
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
./src/gaussian_yolo_layer.c:78:38: warning:
passing argument 1 of ‘cudaHostAlloc’ from incompatible
pointer type [-Wincompatible-pointer-types]
if (cudaSuccess == cudaHostAlloc(&l.delta, batch*l.outputs
* sizeof(float), cudaHostRegisterMapped)) l.delta_pinned = 1;
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/gaussian_yolo_layer.h:5,
from ./src/gaussian_yolo_layer.c:7:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
./src/gaussian_yolo_layer.c: In function
‘resize_gaussian_yolo_layer’:
./src/gaussian_yolo_layer.c:110:42: warning:
passing argument 1 of ‘cudaHostAlloc’ from incompatible
pointer type [-Wincompatible-pointer-types]
if (cudaSuccess != cudaHostAlloc(&l->output,
l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) {
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/gaussian_yolo_layer.h:5,
from ./src/gaussian_yolo_layer.c:7:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
./src/gaussian_yolo_layer.c:119:42: warning:
passing argument 1 of ‘cudaHostAlloc’ from incompatible
pointer type [-Wincompatible-pointer-types]
if (cudaSuccess != cudaHostAlloc(&l->delta,
l->batch*l->outputs * sizeof(float), cudaHostRegisterMapped)) {
^
In file included from /usr/local/cuda/include/cuda_runtime.h:96:0,
from include/darknet.h:41,
from ./src/gaussian_yolo_layer.h:5,

22
from ./src/gaussian_yolo_layer.c:7:
/usr/local/cuda/include/cuda_runtime_api.h:4391:39:
note: expected ‘void **’ but argument is of type
‘float **’
extern __host__ cudaError_t CUDARTAPI cudaHostAlloc(void
**pHost, size_t size, unsigned int flags);
^~~~~~~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/upsample_layer.c -o obj/upsample_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/lstm_layer.c -o obj/lstm_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/conv_lstm_layer.c -o obj/conv_lstm_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/scale_channels_layer.c -o obj/scale_channels_layer.o
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2>
/dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/
-DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-
pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include
-DCUDNN_HALF -c ./src/sam_layer.c -o obj/sam_layer.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/convolutional_kernels.cu -o obj/convolutional_kernels.o
./src/convolutional_kernels.cu: In function ‘void
backward_convolutional_layer_gpu(convolutional_layer, network_state)’:
./src/convolutional_kernels.cu:853:40: warning:
comparison between signed and unsigned integer expressions

23
[-Wsign-compare]
if (*state.net.max_output16_size < l.nweights)
{
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/activation_kernels.cu -o obj/activation_kernels.o
./src/activation_kernels.cu(263): warning: variable "MISH_THRESHOLD" was
declared but never referenced

./src/activation_kernels.cu(263): warning: variable "MISH_THRESHOLD" was


declared but never referenced

./src/activation_kernels.cu(263): warning: variable "MISH_THRESHOLD" was


declared but never referenced

./src/activation_kernels.cu(263): warning: variable "MISH_THRESHOLD" was


declared but never referenced

./src/activation_kernels.cu(263): warning: variable "MISH_THRESHOLD" was


declared but never referenced

./src/activation_kernels.cu(263): warning: variable "MISH_THRESHOLD" was


declared but never referenced

nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35


-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/im2col_kernels.cu -o obj/im2col_kernels.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags

24
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/col2im_kernels.cu -o obj/col2im_kernels.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/blas_kernels.cu -o obj/blas_kernels.o
./src/blas_kernels.cu(1086): warning: variable "out_index" was declared but
never referenced

./src/blas_kernels.cu(1130): warning: variable "step" was set but never used

./src/blas_kernels.cu(1736): warning: variable "stage_id" was declared but never


referenced

./src/blas_kernels.cu(1086): warning: variable "out_index" was declared but


never referenced

./src/blas_kernels.cu(1130): warning: variable "step" was set but never used

./src/blas_kernels.cu(1736): warning: variable "stage_id" was declared but never


referenced

./src/blas_kernels.cu(1086): warning: variable "out_index" was declared but


never referenced

./src/blas_kernels.cu(1130): warning: variable "step" was set but never used

./src/blas_kernels.cu(1736): warning: variable "stage_id" was declared but never


referenced

./src/blas_kernels.cu(1086): warning: variable "out_index" was declared but


never referenced

./src/blas_kernels.cu(1130): warning: variable "step" was set but never used

./src/blas_kernels.cu(1736): warning: variable "stage_id" was declared but never


referenced

./src/blas_kernels.cu(1086): warning: variable "out_index" was declared but


never referenced

25
./src/blas_kernels.cu(1130): warning: variable "step" was set but never used

./src/blas_kernels.cu(1736): warning: variable "stage_id" was declared but never


referenced

./src/blas_kernels.cu(1086): warning: variable "out_index" was declared but


never referenced

./src/blas_kernels.cu(1130): warning: variable "step" was set but never used

./src/blas_kernels.cu(1736): warning: variable "stage_id" was declared but never


referenced

./src/blas_kernels.cu: In function ‘void


backward_shortcut_multilayer_gpu(int, int, int, int*, float**, float*, float*,
float*, float*, int, float*, float**, WEIGHTS_NORMALIZATION_T)’:
./src/blas_kernels.cu:1130:5: warning: variable
‘step’ set but not used [-Wunused-but-set-
variable]
int step = 0;
^~~~
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/crop_layer_kernels.cu -o obj/crop_layer_kernels.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/dropout_layer_kernels.cu -o obj/dropout_layer_kernels.o
./src/dropout_layer_kernels.cu(140): warning: variable "cur_scale" was declared
but never referenced

./src/dropout_layer_kernels.cu(245): warning: variable "cur_scale" was declared

26
but never referenced

./src/dropout_layer_kernels.cu(262): warning: variable "block_prob" was declared


but never referenced

./src/dropout_layer_kernels.cu(140): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(245): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(262): warning: variable "block_prob" was declared


but never referenced

./src/dropout_layer_kernels.cu(140): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(245): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(262): warning: variable "block_prob" was declared


but never referenced

./src/dropout_layer_kernels.cu(140): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(245): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(262): warning: variable "block_prob" was declared


but never referenced

./src/dropout_layer_kernels.cu(140): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(245): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(262): warning: variable "block_prob" was declared


but never referenced

./src/dropout_layer_kernels.cu(140): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(245): warning: variable "cur_scale" was declared


but never referenced

./src/dropout_layer_kernels.cu(262): warning: variable "block_prob" was declared

27
but never referenced

nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35


-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/maxpool_layer_kernels.cu -o obj/maxpool_layer_kernels.o
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/network_kernels.cu -o obj/network_kernels.o
./src/network_kernels.cu(364): warning: variable "l" was declared but never
referenced

./src/network_kernels.cu(364): warning: variable "l" was declared but never


referenced

./src/network_kernels.cu(364): warning: variable "l" was declared but never


referenced

./src/network_kernels.cu(364): warning: variable "l" was declared but never


referenced

./src/network_kernels.cu(364): warning: variable "l" was declared but never


referenced

./src/network_kernels.cu(364): warning: variable "l" was declared but never


referenced

./src/network_kernels.cu: In function ‘float


train_network_datum_gpu(network, float*, float*)’:
./src/network_kernels.cu:364:7: warning: variable
‘l’ set but not used [-Wunused-but-set-variable]
layer l = net.layers[net.n - 1];
^
nvcc -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35

28
-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] -gencode
arch=compute_70,code=[sm_70,compute_70] -Iinclude/ -I3rdparty/stb/include
-DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags
opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF --compiler-options
"-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast
-DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -DCUDNN_HALF" -c
./src/avgpool_layer_kernels.cu -o obj/avgpool_layer_kernels.o
g++ -std=c++11 -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config
--cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU
-I/usr/local/cuda/include/ -DCUDNN -DCUDNN_HALF -Wall -Wfatal-errors -Wno-
unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN
-I/usr/local/cudnn/include -DCUDNN_HALF obj/image_opencv.o obj/http_stream.o
obj/gemm.o obj/utils.o obj/dark_cuda.o obj/convolutional_layer.o obj/list.o
obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o
obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o
obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o
obj/parser.o obj/option_list.o obj/darknet.o obj/detection_layer.o obj/captcha.o
obj/route_layer.o obj/writing.o obj/box.o obj/nightmare.o
obj/normalization_layer.o obj/avgpool_layer.o obj/coco.o obj/dice.o obj/yolo.o
obj/detector.o obj/layer.o obj/compare.o obj/classifier.o obj/local_layer.o
obj/swag.o obj/shortcut_layer.o obj/activation_layer.o obj/rnn_layer.o
obj/gru_layer.o obj/rnn.o obj/rnn_vid.o obj/crnn_layer.o obj/demo.o obj/tag.o
obj/cifar.o obj/go.o obj/batchnorm_layer.o obj/art.o obj/region_layer.o
obj/reorg_layer.o obj/reorg_old_layer.o obj/super.o obj/voxel.o obj/tree.o
obj/yolo_layer.o obj/gaussian_yolo_layer.o obj/upsample_layer.o obj/lstm_layer.o
obj/conv_lstm_layer.o obj/scale_channels_layer.o obj/sam_layer.o
obj/convolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o
obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o
obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/network_kernels.o
obj/avgpool_layer_kernels.o -o darknet -lm -pthread `pkg-config --libs opencv4
2> /dev/null || pkg-config --libs opencv` -L/usr/local/cuda/lib64 -lcuda
-lcudart -lcublas -lcurand -L/usr/local/cudnn/lib64 -lcudnn -lstdc++

1.0.2 Download pre-trained YOLOv4 weights

[5]: !wget https://github.com/AlexeyAB/darknet/releases/download/


,→darknet_yolo_v3_optimal/yolov4.weights

--2020-11-07 12:43:37-- https://github.com/AlexeyAB/darknet/releases/download/d


arknet_yolo_v3_optimal/yolov4.weights
Resolving github.com (github.com)… 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/753889
65/ba4b6380-889c-11ea-9751-f994f5961796?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-
Credential=AKIAIWNJYAX4CSVEH53A%2F20201107%2Fus-

29
east-1%2Fs3%2Faws4_request&X-Amz-Date=20201107T124337Z&X-Amz-Expires=300&X-Amz-S
ignature=3dd0c79851d0d3e80a83b42731f8c4444edb63decb2a49cde98e4ab428ec5f61&X-Amz-
SignedHeaders=host&actor_id=0&key_id=0&repo_id=75388965&response-content-
disposition=attachment%3B%20filename%3Dyolov4.weights&response-content-
type=application%2Foctet-stream [following]
--2020-11-07 12:43:37-- https://github-production-release-asset-2e65be.s3.amazo
naws.com/75388965/ba4b6380-889c-11ea-9751-f994f5961796?X-Amz-
Algorithm=AWS4-HMAC-SHA256&X-Amz-
Credential=AKIAIWNJYAX4CSVEH53A%2F20201107%2Fus-
east-1%2Fs3%2Faws4_request&X-Amz-Date=20201107T124337Z&X-Amz-Expires=300&X-Amz-S
ignature=3dd0c79851d0d3e80a83b42731f8c4444edb63decb2a49cde98e4ab428ec5f61&X-Amz-
SignedHeaders=host&actor_id=0&key_id=0&repo_id=75388965&response-content-
disposition=attachment%3B%20filename%3Dyolov4.weights&response-content-
type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-
production-release-asset-2e65be.s3.amazonaws.com)… 52.216.170.3
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-
production-release-asset-2e65be.s3.amazonaws.com)|52.216.170.3|:443…
connected.
HTTP request sent, awaiting response… 200 OK
Length: 257717640 (246M) [application/octet-stream]
Saving to: ‘yolov4.weights’

yolov4.weights 100%[===================>] 245.78M 95.9MB/s in 2.6s

2020-11-07 12:43:40 (95.9 MB/s) - ‘yolov4.weights’ saved [257717640/257717640]

[ ]:

1.0.3 Define Helper Functions


[6]: # define helper functions
def imShow(path):
import cv2
import matplotlib.pyplot as plt
%matplotlib inline

image = cv2.imread(path)
height, width = image.shape[:2]
resized_image = cv2.resize(image,(2*width, 2*height), interpolation = cv2.
,→INTER_CUBIC)

fig = plt.gcf()
fig.set_size_inches(18, 10)
plt.axis("off")
plt.imshow(cv2.cvtColor(resized_image, cv2.COLOR_BGR2RGB))

30
plt.show()

# use this to upload files


def upload():
from google.colab import files
uploaded = files.upload()
for name, data in uploaded.items():
with open(name, 'wb') as f:
f.write(data)
print ('saved file', name)

# use this to download a file


def download(path):
from google.colab import files
files.download(path)

[ ]:

1.0.4 Testing the setup with darknet


Run Your Detections with Darknet and YOLOv4!
[8]: # run darknet detection on test images
!./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights data/
,→person.jpg

# show image using our helper function


imShow('predictions.jpg')

CUDA-version: 10010 (10010), cuDNN: 7.6.5, CUDNN_HALF=1, GPU count: 1


CUDNN_HALF=1
OpenCV version: 3.2.0
0 : compute_capability = 750, cudnn_half = 1, GPU: Tesla T4
net.optimized_memory = 0
mini_batch = 1, batch = 8, time_steps = 1, train = 0
layer filters size/strd(dil) input output
0 conv 32 3 x 3/ 1 608 x 608 x 3 -> 608 x 608 x 32 0.639 BF
1 conv 64 3 x 3/ 2 608 x 608 x 32 -> 304 x 304 x 64 3.407 BF
2 conv 64 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 64 0.757 BF
3 route 1 -> 304 x 304 x 64
4 conv 64 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 64 0.757 BF
5 conv 32 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 32 0.379 BF
6 conv 64 3 x 3/ 1 304 x 304 x 32 -> 304 x 304 x 64 3.407 BF
7 Shortcut Layer: 4, wt = 0, wn = 0, outputs: 304 x 304 x 64 0.006 BF
8 conv 64 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 64 0.757 BF
9 route 8 2 -> 304 x 304 x 128
10 conv 64 1 x 1/ 1 304 x 304 x 128 -> 304 x 304 x 64 1.514 BF
11 conv 128 3 x 3/ 2 304 x 304 x 64 -> 152 x 152 x 128 3.407 BF
12 conv 64 1 x 1/ 1 152 x 152 x 128 -> 152 x 152 x 64 0.379 BF

31
13 route 11 -> 152 x 152 x 128
14 conv 64 1 x 1/ 1 152 x 152 x 128 -> 152 x 152 x 64 0.379 BF
15 conv 64 1 x 1/ 1 152 x 152 x 64 -> 152 x 152 x 64 0.189 BF
16 conv 64 3 x 3/ 1 152 x 152 x 64 -> 152 x 152 x 64 1.703 BF
17 Shortcut Layer: 14, wt = 0, wn = 0, outputs: 152 x 152 x 64 0.001 BF
18 conv 64 1 x 1/ 1 152 x 152 x 64 -> 152 x 152 x 64 0.189 BF
19 conv 64 3 x 3/ 1 152 x 152 x 64 -> 152 x 152 x 64 1.703 BF
20 Shortcut Layer: 17, wt = 0, wn = 0, outputs: 152 x 152 x 64 0.001 BF
21 conv 64 1 x 1/ 1 152 x 152 x 64 -> 152 x 152 x 64 0.189 BF
22 route 21 12 -> 152 x 152 x 128
23 conv 128 1 x 1/ 1 152 x 152 x 128 -> 152 x 152 x 128 0.757 BF
24 conv 256 3 x 3/ 2 152 x 152 x 128 -> 76 x 76 x 256 3.407 BF
25 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
26 route 24 -> 76 x 76 x 256
27 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
28 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
29 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
30 Shortcut Layer: 27, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
31 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
32 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
33 Shortcut Layer: 30, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
34 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
35 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
36 Shortcut Layer: 33, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
37 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
38 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
39 Shortcut Layer: 36, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
40 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
41 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
42 Shortcut Layer: 39, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
43 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
44 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
45 Shortcut Layer: 42, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
46 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
47 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
48 Shortcut Layer: 45, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
49 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
50 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
51 Shortcut Layer: 48, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
52 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
53 route 52 25 -> 76 x 76 x 256
54 conv 256 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 256 0.757 BF
55 conv 512 3 x 3/ 2 76 x 76 x 256 -> 38 x 38 x 512 3.407 BF
56 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
57 route 55 -> 38 x 38 x 512
58 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
59 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
60 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF

32
61 Shortcut Layer: 58, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
62 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
63 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
64 Shortcut Layer: 61, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
65 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
66 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
67 Shortcut Layer: 64, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
68 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
69 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
70 Shortcut Layer: 67, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
71 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
72 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
73 Shortcut Layer: 70, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
74 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
75 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
76 Shortcut Layer: 73, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
77 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
78 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
79 Shortcut Layer: 76, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
80 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
81 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
82 Shortcut Layer: 79, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
83 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
84 route 83 56 -> 38 x 38 x 512
85 conv 512 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 512 0.757 BF
86 conv 1024 3 x 3/ 2 38 x 38 x 512 -> 19 x 19 x1024 3.407 BF
87 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
88 route 86 -> 19 x 19 x1024
89 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
90 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
91 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
92 Shortcut Layer: 89, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
93 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
94 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
95 Shortcut Layer: 92, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
96 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
97 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
98 Shortcut Layer: 95, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
99 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
100 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
101 Shortcut Layer: 98, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
102 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
103 route 102 87 -> 19 x 19 x1024
104 conv 1024 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x1024 0.757 BF
105 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
106 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
107 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
108 max 5x 5/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.005 BF

33
109 route 107 -> 19 x 19 x 512
110 max 9x 9/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.015 BF
111 route 107 -> 19 x 19 x 512
112 max 13x13/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.031 BF
113 route 112 110 108 107 -> 19 x 19 x2048
114 conv 512 1 x 1/ 1 19 x 19 x2048 -> 19 x 19 x 512 0.757 BF
115 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
116 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
117 conv 256 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 256 0.095 BF
118 upsample 2x 19 x 19 x 256 -> 38 x 38 x 256
119 route 85 -> 38 x 38 x 512
120 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
121 route 120 118 -> 38 x 38 x 512
122 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
123 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
124 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
125 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
126 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
127 conv 128 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 128 0.095 BF
128 upsample 2x 38 x 38 x 128 -> 76 x 76 x 128
129 route 54 -> 76 x 76 x 256
130 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
131 route 130 128 -> 76 x 76 x 256
132 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
133 conv 256 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BF
134 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
135 conv 256 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BF
136 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
137 conv 256 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BF
138 conv 255 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 255 0.754 BF
139 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm:
1.00, delta_norm: 1.00, scale_x_y: 1.20
nms_kind: greedynms (1), beta = 0.600000
140 route 136 -> 76 x 76 x 128
141 conv 256 3 x 3/ 2 76 x 76 x 128 -> 38 x 38 x 256 0.852 BF
142 route 141 126 -> 38 x 38 x 512
143 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
144 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
145 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
146 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
147 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
148 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
149 conv 255 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 255 0.377 BF
150 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm:
1.00, delta_norm: 1.00, scale_x_y: 1.10
nms_kind: greedynms (1), beta = 0.600000

34
151 route 147 -> 38 x 38 x 256
152 conv 512 3 x 3/ 2 38 x 38 x 256 -> 19 x 19 x 512 0.852 BF
153 route 152 116 -> 19 x 19 x1024
154 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
155 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
156 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
157 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
158 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
159 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
160 conv 255 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 255 0.189 BF
161 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm:
1.00, delta_norm: 1.00, scale_x_y: 1.05
nms_kind: greedynms (1), beta = 0.600000
Total BFLOPS 128.459
avg_outputs = 1068395
Allocate additional workspace_size = 52.43 MB
Loading weights from yolov4.weights…
seen 64, trained: 32032 K-images (500 Kilo-batches_64)
Done! Loaded 162 layers from weights-file
Detection layer: 139 - type = 28
Detection layer: 150 - type = 28
Detection layer: 161 - type = 28
data/person.jpg: Predicted in 54.795000 milli-seconds.
dog: 99%
person: 100%
horse: 98%
Unable to init server: Could not connect: Connection refused

(predictions:1174): Gtk-WARNING **: 12:47:10.565: cannot


open display:

35
1.0.5 uploading images from local computer by the help of the upload fuction that
we have created
[11]: # try out the upload helper function!
%cd ..
upload()
%cd darknet

/content
<IPython.core.display.HTML object>

Saving market.jpg to market.jpg


saved file market.jpg
/content/darknet

[12]: # run darknet with YOLOv4 on your personal image!


!./darknet detector test cfg/coco.data cfg/yolov4.cfg yolov4.weights ../market.
,→jpg

imShow('predictions.jpg')

CUDA-version: 10010 (10010), cuDNN: 7.6.5, CUDNN_HALF=1, GPU count: 1


CUDNN_HALF=1

36
OpenCV version: 3.2.0
0 : compute_capability = 750, cudnn_half = 1, GPU: Tesla T4
net.optimized_memory = 0
mini_batch = 1, batch = 8, time_steps = 1, train = 0
layer filters size/strd(dil) input output
0 conv 32 3 x 3/ 1 608 x 608 x 3 -> 608 x 608 x 32 0.639 BF
1 conv 64 3 x 3/ 2 608 x 608 x 32 -> 304 x 304 x 64 3.407 BF
2 conv 64 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 64 0.757 BF
3 route 1 -> 304 x 304 x 64
4 conv 64 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 64 0.757 BF
5 conv 32 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 32 0.379 BF
6 conv 64 3 x 3/ 1 304 x 304 x 32 -> 304 x 304 x 64 3.407 BF
7 Shortcut Layer: 4, wt = 0, wn = 0, outputs: 304 x 304 x 64 0.006 BF
8 conv 64 1 x 1/ 1 304 x 304 x 64 -> 304 x 304 x 64 0.757 BF
9 route 8 2 -> 304 x 304 x 128
10 conv 64 1 x 1/ 1 304 x 304 x 128 -> 304 x 304 x 64 1.514 BF
11 conv 128 3 x 3/ 2 304 x 304 x 64 -> 152 x 152 x 128 3.407 BF
12 conv 64 1 x 1/ 1 152 x 152 x 128 -> 152 x 152 x 64 0.379 BF
13 route 11 -> 152 x 152 x 128
14 conv 64 1 x 1/ 1 152 x 152 x 128 -> 152 x 152 x 64 0.379 BF
15 conv 64 1 x 1/ 1 152 x 152 x 64 -> 152 x 152 x 64 0.189 BF
16 conv 64 3 x 3/ 1 152 x 152 x 64 -> 152 x 152 x 64 1.703 BF
17 Shortcut Layer: 14, wt = 0, wn = 0, outputs: 152 x 152 x 64 0.001 BF
18 conv 64 1 x 1/ 1 152 x 152 x 64 -> 152 x 152 x 64 0.189 BF
19 conv 64 3 x 3/ 1 152 x 152 x 64 -> 152 x 152 x 64 1.703 BF
20 Shortcut Layer: 17, wt = 0, wn = 0, outputs: 152 x 152 x 64 0.001 BF
21 conv 64 1 x 1/ 1 152 x 152 x 64 -> 152 x 152 x 64 0.189 BF
22 route 21 12 -> 152 x 152 x 128
23 conv 128 1 x 1/ 1 152 x 152 x 128 -> 152 x 152 x 128 0.757 BF
24 conv 256 3 x 3/ 2 152 x 152 x 128 -> 76 x 76 x 256 3.407 BF
25 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
26 route 24 -> 76 x 76 x 256
27 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
28 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
29 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
30 Shortcut Layer: 27, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
31 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
32 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
33 Shortcut Layer: 30, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
34 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
35 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
36 Shortcut Layer: 33, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
37 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
38 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
39 Shortcut Layer: 36, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
40 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
41 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
42 Shortcut Layer: 39, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF

37
43 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
44 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
45 Shortcut Layer: 42, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
46 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
47 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
48 Shortcut Layer: 45, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
49 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
50 conv 128 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 128 1.703 BF
51 Shortcut Layer: 48, wt = 0, wn = 0, outputs: 76 x 76 x 128 0.001 BF
52 conv 128 1 x 1/ 1 76 x 76 x 128 -> 76 x 76 x 128 0.189 BF
53 route 52 25 -> 76 x 76 x 256
54 conv 256 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 256 0.757 BF
55 conv 512 3 x 3/ 2 76 x 76 x 256 -> 38 x 38 x 512 3.407 BF
56 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
57 route 55 -> 38 x 38 x 512
58 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
59 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
60 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
61 Shortcut Layer: 58, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
62 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
63 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
64 Shortcut Layer: 61, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
65 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
66 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
67 Shortcut Layer: 64, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
68 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
69 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
70 Shortcut Layer: 67, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
71 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
72 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
73 Shortcut Layer: 70, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
74 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
75 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
76 Shortcut Layer: 73, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
77 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
78 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
79 Shortcut Layer: 76, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
80 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
81 conv 256 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 256 1.703 BF
82 Shortcut Layer: 79, wt = 0, wn = 0, outputs: 38 x 38 x 256 0.000 BF
83 conv 256 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 256 0.189 BF
84 route 83 56 -> 38 x 38 x 512
85 conv 512 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 512 0.757 BF
86 conv 1024 3 x 3/ 2 38 x 38 x 512 -> 19 x 19 x1024 3.407 BF
87 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
88 route 86 -> 19 x 19 x1024
89 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
90 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF

38
91 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
92 Shortcut Layer: 89, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
93 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
94 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
95 Shortcut Layer: 92, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
96 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
97 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
98 Shortcut Layer: 95, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
99 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
100 conv 512 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x 512 1.703 BF
101 Shortcut Layer: 98, wt = 0, wn = 0, outputs: 19 x 19 x 512 0.000 BF
102 conv 512 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.189 BF
103 route 102 87 -> 19 x 19 x1024
104 conv 1024 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x1024 0.757 BF
105 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
106 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
107 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
108 max 5x 5/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.005 BF
109 route 107 -> 19 x 19 x 512
110 max 9x 9/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.015 BF
111 route 107 -> 19 x 19 x 512
112 max 13x13/ 1 19 x 19 x 512 -> 19 x 19 x 512 0.031 BF
113 route 112 110 108 107 -> 19 x 19 x2048
114 conv 512 1 x 1/ 1 19 x 19 x2048 -> 19 x 19 x 512 0.757 BF
115 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
116 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
117 conv 256 1 x 1/ 1 19 x 19 x 512 -> 19 x 19 x 256 0.095 BF
118 upsample 2x 19 x 19 x 256 -> 38 x 38 x 256
119 route 85 -> 38 x 38 x 512
120 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
121 route 120 118 -> 38 x 38 x 512
122 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
123 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
124 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
125 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
126 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
127 conv 128 1 x 1/ 1 38 x 38 x 256 -> 38 x 38 x 128 0.095 BF
128 upsample 2x 38 x 38 x 128 -> 76 x 76 x 128
129 route 54 -> 76 x 76 x 256
130 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
131 route 130 128 -> 76 x 76 x 256
132 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
133 conv 256 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BF
134 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
135 conv 256 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BF
136 conv 128 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 128 0.379 BF
137 conv 256 3 x 3/ 1 76 x 76 x 128 -> 76 x 76 x 256 3.407 BF
138 conv 255 1 x 1/ 1 76 x 76 x 256 -> 76 x 76 x 255 0.754 BF

39
139 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm:
1.00, delta_norm: 1.00, scale_x_y: 1.20
nms_kind: greedynms (1), beta = 0.600000
140 route 136 -> 76 x 76 x 128
141 conv 256 3 x 3/ 2 76 x 76 x 128 -> 38 x 38 x 256 0.852 BF
142 route 141 126 -> 38 x 38 x 512
143 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
144 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
145 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
146 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
147 conv 256 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 256 0.379 BF
148 conv 512 3 x 3/ 1 38 x 38 x 256 -> 38 x 38 x 512 3.407 BF
149 conv 255 1 x 1/ 1 38 x 38 x 512 -> 38 x 38 x 255 0.377 BF
150 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm:
1.00, delta_norm: 1.00, scale_x_y: 1.10
nms_kind: greedynms (1), beta = 0.600000
151 route 147 -> 38 x 38 x 256
152 conv 512 3 x 3/ 2 38 x 38 x 256 -> 19 x 19 x 512 0.852 BF
153 route 152 116 -> 19 x 19 x1024
154 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
155 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
156 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
157 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
158 conv 512 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 512 0.379 BF
159 conv 1024 3 x 3/ 1 19 x 19 x 512 -> 19 x 19 x1024 3.407 BF
160 conv 255 1 x 1/ 1 19 x 19 x1024 -> 19 x 19 x 255 0.189 BF
161 yolo
[yolo] params: iou loss: ciou (4), iou_norm: 0.07, obj_norm: 1.00, cls_norm:
1.00, delta_norm: 1.00, scale_x_y: 1.05
nms_kind: greedynms (1), beta = 0.600000
Total BFLOPS 128.459
avg_outputs = 1068395
Allocate additional workspace_size = 52.43 MB
Loading weights from yolov4.weights…
seen 64, trained: 32032 K-images (500 Kilo-batches_64)
Done! Loaded 162 layers from weights-file
Detection layer: 139 - type = 28
Detection layer: 150 - type = 28
Detection layer: 161 - type = 28
../market.jpg: Predicted in 54.648000 milli-seconds.
person: 81%
chair: 91%
person: 92%
person: 40%
person: 68%
person: 62%

40
person: 38%
person: 99%
person: 98%
person: 80%
person: 68%
person: 58%
person: 58%
person: 31%
person: 94%
person: 69%
person: 99%
person: 83%
bus: 48%
person: 47%
person: 87%
car: 42%
person: 51%
car: 43%
handbag: 66%
handbag: 91%
person: 99%
person: 33%
person: 82%
Unable to init server: Could not connect: Connection refused

(predictions:1270): Gtk-WARNING **: 13:02:44.183: cannot


open display:

41
2 Reference
1. https://colab.research.google.com/drive/12QusaaRj_lUwCGDvQNfICpa7kA7_a2dE#scrollTo=Lgf-
ZUbqbb4K
2. https://wiki.loliot.net/docs/lang/python/libraries/yolov4/python-yolov4-dataset/

42

You might also like