[16주차] NLP II와 Visual Recognition

2023. 7. 21. 11:34BOOTCAMP/프로그래머스 인공지능 데브코스

Darknet을 이용하여 커스텀 YOLOv3을 빌드하기

This tutorial is a copy of the one made by 'The AI Guy'. The link to the original tutorial and the author is : The AI Guy

폴더등과 관련된 몇 가지 오류를 수정하고 한글화함

1. Darknet를 clone하기

다음 셀들은

  1. AlexeyAB repository에서 darknet을 clone하고
  2. darknet에서 OPENCV and GPU의 사용을 enable하기 위해 make파일을 수정하고
  3. darknet을 빌드함
In [1]:
# darknet repository에서 clone하기 !git clone https://github.com/AlexeyAB/darknet
Cloning into 'darknet'...
remote: Enumerating objects: 14691, done.
remote: Total 14691 (delta 0), reused 0 (delta 0), pack-reused 14691
Receiving objects: 100% (14691/14691), 13.27 MiB | 24.70 MiB/s, done.
Resolving deltas: 100% (9995/9995), done.
In [2]:
#GPU와 OPENCV의 사용이 가능하도록 makefile을 수정하기 %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
/content/darknet
In [3]:
# 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
In [4]:
# make를 이용하여 darknet를 build !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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/image_opencv.cpp -o 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 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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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) {
                          ~~~~~~~^~~~~~~~~~~~~~~~~
./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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/utils.c -o obj/utils.o
./src/utils.c: In function ‘custom_hash’:
./src/utils.c:1045: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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/dark_cuda.c -o obj/dark_cuda.o
./src/dark_cuda.c: In function ‘cudnn_check_error_extended’:
./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}’ [-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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/convolutional_layer.c -o obj/convolutional_layer.o
./src/convolutional_layer.c: In function ‘forward_convolutional_layer’:
./src/convolutional_layer.c:1341: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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/blas.c -o obj/blas.o
./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
./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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/crop_layer.c -o obj/crop_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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/data.c -o obj/data.o
./src/data.c: In function ‘load_data_detection’:
./src/data.c:1297:24: warning: unused variable ‘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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/network.c -o obj/network.o
./src/network.c: In function ‘train_network_waitkey’:
./src/network.c:433:13: warning: unused variable ‘ema_period’ [-Wunused-variable]
         int ema_period = (net.max_batches - ema_start_point - 1000) * (1.0 - net.ema_alpha);
             ^~~~~~~~~~
./src/network.c: In function ‘resize_network’:
./src/network.c:658: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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/parser.c -o obj/parser.o
./src/parser.c: In function ‘parse_network_cfg_custom’:
./src/parser.c:1680: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: 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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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_";
           ^~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/detector.c -o obj/detector.o
./src/detector.c: In function ‘train_detector’:
./src/detector.c:386:72: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
             (iteration >= (iter_save + 1000) || iteration % 1000 == 0) && net.max_batches < 10000)
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
./src/detector.c: In function ‘print_cocos’:
./src/detector.c:486: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:579: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:700:13: warning: unused variable ‘mkd2’ [-Wunused-variable]
         int mkd2 = make_directory(buff2, 0777);
             ^~~~
./src/detector.c:698:13: warning: unused variable ‘mkd’ [-Wunused-variable]
         int mkd = make_directory(buff, 0777);
             ^~~
./src/detector.c: In function ‘validate_detector_map’:
./src/detector.c:1332: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:1331: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]);
               ^~~~~~~~~~~~~~~
./src/detector.c: In function ‘draw_object’:
./src/detector.c:1867: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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/layer.c -o obj/layer.o
./src/layer.c: In function ‘free_layer_custom’:
./src/layer.c:208: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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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]
         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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/rnn_vid.c -o obj/rnn_vid.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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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;
                                      ^
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);
                                       ^~~~~~~~~~~~~
./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 ‘process_batch’:
./src/yolo_layer.c:426:25: warning: variable ‘best_match_t’ set but not used [-Wunused-but-set-variable]
                     int best_match_t = 0;
                         ^~~~~~~~~~~~
./src/yolo_layer.c: In function ‘forward_yolo_layer’:
./src/yolo_layer.c:707:11: warning: unused variable ‘avg_anyobj’ [-Wunused-variable]
     float avg_anyobj = 0;
           ^~~~~~~~~~
./src/yolo_layer.c:706:11: warning: unused variable ‘avg_obj’ [-Wunused-variable]
     float avg_obj = 0;
           ^~~~~~~
./src/yolo_layer.c:705:11: warning: unused variable ‘avg_cat’ [-Wunused-variable]
     float avg_cat = 0;
           ^~~~~~~
./src/yolo_layer.c:704:11: warning: unused variable ‘recall75’ [-Wunused-variable]
     float recall75 = 0;
           ^~~~~~~~
./src/yolo_layer.c:703:11: warning: unused variable ‘recall’ [-Wunused-variable]
     float recall = 0;
           ^~~~~~
./src/yolo_layer.c:702:11: warning: unused variable ‘tot_ciou_loss’ [-Wunused-variable]
     float tot_ciou_loss = 0;
           ^~~~~~~~~~~~~
./src/yolo_layer.c:701:11: warning: unused variable ‘tot_diou_loss’ [-Wunused-variable]
     float tot_diou_loss = 0;
           ^~~~~~~~~~~~~
./src/yolo_layer.c:698:11: warning: unused variable ‘tot_ciou’ [-Wunused-variable]
     float tot_ciou = 0;
           ^~~~~~~~
./src/yolo_layer.c:697:11: warning: unused variable ‘tot_diou’ [-Wunused-variable]
     float tot_diou = 0;
           ^~~~~~~~
./src/yolo_layer.c:696:11: warning: unused variable ‘tot_giou’ [-Wunused-variable]
     float tot_giou = 0;
           ^~~~~~~~
./src/yolo_layer.c:668:12: warning: unused variable ‘n’ [-Wunused-variable]
     int b, n;
            ^
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 **’
 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,
                 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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c ./src/sam_layer.c -o obj/sam_layer.o
nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -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 [-Wsign-compare]
                 if (*state.net.max_output16_size < l.nweights) {
                 ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -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

nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -c ./src/im2col_kernels.cu -o obj/im2col_kernels.o
nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -c ./src/col2im_kernels.cu -o obj/col2im_kernels.o
nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -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: 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_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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -c ./src/crop_layer_kernels.cu -o obj/crop_layer_kernels.o
nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -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 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

nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -c ./src/maxpool_layer_kernels.cu -o obj/maxpool_layer_kernels.o
nvcc -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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -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: 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_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] -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN --compiler-options "-Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include" -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 -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include 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++

2. Helper 함수 정의

업로드, 다운로드, imShow등과 관련된 함수 정의

In [5]:
# helper함수들 def imShow(path): import cv2 import matplotlib.pyplot as plt %matplotlib inline image = cv2.imread(path) #경로로부터 이미지를 불러읽어들여서 height, width = image.shape[:2] #현재 영상의 height와 width를 읽어서 resized_image = cv2.resize(image,(3*width, 3*height), interpolation = cv2.INTER_CUBIC) #영상을 3배로 키운다(크게 보여주기 위해서) fig = plt.gcf() fig.set_size_inches(18, 10) plt.axis("off") plt.imshow(cv2.cvtColor(resized_image, cv2.COLOR_BGR2RGB)) #opencv로 읽어들인 영상은 BGR포맷을 갖기 때문에 RGB포맷으로 변환해야 함 plt.show() # google colab으로 파일을 업로드할 때 사용하는 함수를 정의 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) # google colab에서 파일을 다운로드할 때 사용하는 함수를 정의 def download(path): from google.colab import files files.download(path)
In [6]:
%cd .. from google.colab import drive drive.mount('/content/gdrive')
/content
Mounted at /content/gdrive
In [7]:
# 다음은 /content/gdrive/My\ Drive/ 의 경로를 /mydrive 로 접근할 수 있도록 링크를 만들어준다. !ln -s /content/gdrive/My\ Drive/ /mydrive !ls /mydrive
 디모자이킹			 '정보통신공학과 홍보.gdoc'
 동서클러스터			 '프로그래밍 기초.gjam'
 정보통신공학홍보		  images
'딥러닝워크샵(2019.7.25)'	  InlineSports
'정보통신공학과 홍보영상-6.mp4'  'My Drive'
'Colab Notebooks'		 'See You On The Otherside - The 126ers.mp3'
 computervision			 'Software Development 4.gjam'
'computer vision.gjam'		  TensorFlow_Training_16th
 보고서.gdoc			  yolov3
 장고튜토리얼.gdoc		  yolov3_custom_last.weights

3. 클라우드에서 커스텀 YOLOv3 Object Detector를 학습시키기

커스텀 YOLOv3 detector를 학습하려면 다음이 필요하다:

  • 라벨을 가진 커스텀 데이터셋
  • 커스텀 .cfg file
  • obj.data 와 obj.names 파일들
  • train.txt file (test.txt 는 있어도 되고 없어도 됨)

Step 1: 커스텀 데이터셋 마련

커스텀 custom object detector를 만들려면 이미지와 라벨을 가진 데이터셋을 마련해야 한다.

다음의 2가지 방법을 이용할 수 있다.

방법 1: 구글의 Open Images Dataset을 이용하기

구글의 Open Images Dataset에서 데이터셋을 얻어서 OIDv4 toolkit 등으로 라벨을 생성하는 방법은 쉽고 빠르다. 구글의 Open Images Dataset은 600개가 넘는 클래스들에 대하여 라벨링이 된 이미지들을 가지고 있다. 여기서 데이터셋을 찾아보기

다음 비디오에는 구글의 Open Images Dataset을 이용하여 자신만의 커스텀 데이터셋을 만드는 방법에 대해 설명하고 있다:

Creating a Custom YOLOv3 Dataset (Video)

다음 링크는 OIDv4 toolkit! 에 대한 Gihub의 repository에 대한 링크임: Github Repo

이 튜토리얼에서는 구글의 Open Images Dataset을 이용하여 safari animal object detector를 위한 이미지 데이터셋을 만들고자 한다. OIDv4 toolkit안에서 다음의 코멘드를 실행한다.

python main.py downloader --classes Elephant Giraffe Hippopotamus Tiger Zebra --type_csv train --limit 300 --multiclasses 1

그러면 Elephant, Giraffe, Hippopotamus, Tiger, Zebra의 영상들이 하나의 폴더에 들어가게 된다. 각 클래스에 대해 300개의 이미지가 생겨서 전체적으로는 1500개의 영상이 하나의 폴더 안에 생기게 된다.

OIDv4_ToolKit의 root folder폴더에서 classes.txt라는 파일을 열고 다음과 같이 각 라인에 클래스명을 하나씩 적어놓는다. 

이제 다음의 명령문으로 이미지의 annotation을 변환시키면 됨:

python convert_annotations.py

위의 명령문은 모든 라벨을 YOLOv3에서 사용하는 포맷으로 변환시켜서 커스텀 object detector를 학습시킬 수 있는 형태가 되게 한다.

OIDv4 toolkit의 옛날 'Label' 폴더 제거하기: 다음 명령문을 실행하여 YOLOv3에서 사용하지 못하는 라벨을 제거한다: (경로명은 어떤 클래스를 다운로드를 하였는지에 따라 달라진다.

rm -r OID/Dataset/train/Elephant_Giraffe_Hippopotamus_Tiger_Zebra/Label/

위의 명령어가 먹히지 않으면 직접 'Label'이라는 폴더를 찾아서 제거해도 된다.

모든 이미지와 annotation을 포함하는 폴더의 내용은 다음과 같게 된다. 여기서 각 이미지 이름과 같은 텍스트 파일이 쌍으로 생김을 볼 수 있다.

여기까지 하면 커스텀 YOLOv3 dataset의 생성이 완료된 것임.

방법 2: Annotation Tool을 사용하여 수동으로 annotation을 만들기

만약 구글의 Open Images Dataset에 적당한 이미지나 클래스를 찾을 수 없다면 수동으로 라벨을 그리는 방법이 있다. 이 방법은 상당히 노력이 필요한 방법이다.

밑의 유튜브는 annotation tool인 LabelImg를 사용하여 YOLOv3을 위한 커스텀 데이터셋을 만드는 방법을 설명하고 있다.

Create Labels and Annotations for Custom YOLOv3 Dataset (Video)

위의 튜토리얼 영상을 따라 하면 마찬가지로 이미지와 텍스트파일이 존재하는 폴더가 생길 것이다.

여기까지 하면 커스텀 YOLOv3 dataset의 생성이 완료된 것임.

Step 2: 커스텀 데이터셋을 클라우드에 올리기

데이터셋의 포맷을 학습하기에 적합하도록 변환한 후에는 데이터셋을 클라우드에 올려야 한다.

이미지와 텍스트 파일이 있는 폴더명을 'obj'라고 한 다음에 'obj' 폴더를 zip파일로 압축하여 클라우드로 업로드하고 클라우드에서 zip파일을 압축풀기하면 된다.

In [8]:
# 압축한 zip파일을 넣은 폴더 !ls /mydrive/yolov3
backup	generate_train.py  obj.data  obj.names	obj.zip  yolov3_custom.cfg
In [9]:
cd darknet
/content/darknet
In [10]:
# obj.zip파일을 클라우드의 root directory로 copy하기 !cp /mydrive/yolov3/obj.zip ../
In [11]:
# 다음과 같이 zip파일을 압축풀기하면 파일안의 내용들이 /darknet/data/obj 안에 있게 된다 !unzip ../obj.zip -d data/obj/
Archive:  ../obj.zip
  inflating: data/obj/00371870727e83d8.jpg  
  inflating: data/obj/00371870727e83d8.txt  

Step 3: 학습할 수 있도록 파일들의 설정을 바꾸기

. cfg 파일, obj.data, obj.names, train.txt 파일들에 대해 설정을 바꾸기

다음 유튜브에는 파일들의 설정을 바꾸는 방법이 잘 설명되어 있다 Configuring YOLOv3 Files for Training

i) Cfg 파일

먼저 yolov3.cfg를 copy 하고 편집하기

In [15]:
# cfg파일을 구글 드라이브로 복사하고 이름을 바꾸기 !cp cfg/yolov3.cfg /mydrive/yolov3/yolov3_custom.cfg
In [ ]:
# PC로 다운로드하려면 다음과 같이 하면 된다. 다운로드후에는 파일 이름을 yolov3_custom.cfg로 바꾸면 된다. download('cfg/yolov3.cfg')

이제 편집기를 이용하여. cfg파일을 편집하면 된다.

yolov3_custom.cfg파일 구글 드라이브에 있다면 파일을 더블클릭한 후에 Open with 드롭다운에서 Text Editor를 선택하면 된다. 

추천: batch = 64와subdivisions = 16로 놓는 것을 추천함. 문제가 생기면 subdivisions 은 32까지 올릴 수 있다.

몇 개의 class에 대하여 학습하는지에 따라 변경사항이 달라짐.

여기서는 max_batches = 10000, steps = 8000, 9000, I classes = 5로 놓았고, 각 YOLO 레이어전의 3개의 컨볼루셔널 레이어에서는 filters = 30로 놓았다. (주의 : 이런 classes가 cfg파일 안에 3개가 있다)

옵션: 학습을 빠르게 하려면 cfg파일 안의 yolo레이어에서 random = 1에서random = 0으로 바꿀 수 있음. 대신 정확도는 약간 떨어지게 됨. 이렇게 함으로써 메모리 부족현상도 어느 정도 완화될 수 있다.

save to drive버튼을 눌러서 save 함.

In [16]:
# 커스텀 .cfg 파일을 다시 클라우드로 올림 !cp /mydrive/yolov3/yolov3_custom.cfg ./cfg # 다음과 같이 하면 PC에서 커스텀 .cfg 파일을 클라우드로 올릴 수 있음. #%cd cfg #upload() #%cd ..

ii) obj.names 와 obj.data

obj.names라는 파일명을 만들고 classes.txt에 넣었던 것과 같은 내용을 입력함.

obj.data 파일을 만들고 밑에와 같이 내용을 채움. 클래스의 개수에 맞게 적고 backup 폴더의 위치를 지정하면 됨.

backup 폴더는 학습이 진행될 때 weights값들이 저장이 되는 위치임. 먼저 구글 드라이브에 backup폴더를 만든 후에 이 폴더로 위치를 지정하면 됨.

In [17]:
# obj.names 와 obj.data 파일들을 구글 드라이브에서 클라우드로 올리기 !cp /mydrive/yolov3/obj.names ./data !cp /mydrive/yolov3/obj.data ./data # obj.names 와 obj.data 파일들을 PC에서 클라우드로 올리기 #%cd data #upload() #%cd ..
In [ ]:
ls
darknet/  gdrive/  sample_data/

iii) train.txt 만들기

마지막으로 만들어야 하는 파일은 train.txt파일로, 이 파일은 학습에 사용하는 이미지들에 대한 상대경로를 가지고 있는 파일이다.

train.txt 파일을 생성해 주는 python script를 여기서 얻을 수 있다:Github Repo

이 파일을 PC나 구글드라이브에 다운로드한 후에 클라우드로 올리면 된다.

In [18]:
# 구글드라이브의 generate_train.py 스크립트를 클라우드로 올리기 !cp /mydrive/yolov3/generate_train.py ./ # PC에서 generate_train.py 스크립트를 클라우드로 올리기 #upload()

다음과 같이 python 스크립트를 실행하면 train.txt파일을 생성해 준다.

In [19]:
!python generate_train.py
In [20]:
# darknet/data폴더내에 train.txt이 존재함을 확인해보기 !ls data/
9k.tree     eagle.jpg	 imagenet.labels.list	   obj.data	     scream.jpg
coco9k.map  giraffe.jpg  imagenet.shortnames.list  obj.names	     train.txt
coco.names  goal.txt	 labels			   openimages.names  voc.names
dog.jpg     horses.jpg	 obj			   person.jpg

train.txt을 더블클릭하여 에디터로 내부를 확인해 보면 다음과 같이 보일 것이다.

라인마다 학습 이미지 경로가 존재함을 확인할 수 있다.

Step 4: 사전학습된 weights 들을 다운로드하기

이 step은 YOLOv3 네트워크의 컨볼루션 레이어에 대한 weights들을 다운로드하는 step이다. 사전학습된 weights 들을 이용하면 학습시간을 줄일 수 있고, 정확도도 높일 수 있다.

In [21]:
# 사전학습된 convolutional layer weights를 다운로드하 !wget http://pjreddie.com/media/files/darknet53.conv.74
--2021-02-04 03:06:23--  http://pjreddie.com/media/files/darknet53.conv.74
Resolving pjreddie.com (pjreddie.com)... 128.208.4.108
Connecting to pjreddie.com (pjreddie.com)|128.208.4.108|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://pjreddie.com/media/files/darknet53.conv.74 [following]
--2021-02-04 03:06:23--  https://pjreddie.com/media/files/darknet53.conv.74
Connecting to pjreddie.com (pjreddie.com)|128.208.4.108|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 162482580 (155M) [application/octet-stream]
Saving to: ‘darknet53.conv.74’

darknet53.conv.74   100%[===================>] 154.96M   459KB/s    in 5m 19s  

2021-02-04 03:11:42 (498 KB/s) - ‘darknet53.conv.74’ saved [162482580/162482580]

Step 5: 커스텀 Object Detector를 학습시키기

다음의 명령문으로 커스텀 Object Detector를 학습시킬 수 있다. 여기서 -dont_show 플래그는 chart를 보이지 않게 하는 플래그이다.

!./darknet detector train <path to obj.data> <path to custom config> darknet53.conv.74 -dont_show

TIP: 이 학습은 상당히 오래 걸리는데 구글 colab은 학습하다가 반응이 없으면 중간에 멈춘다. 이것을 방지하기 위해 CTRL + SHIFT + i를 누른 후에 브라우저에 나타나는 console window에 다음의 코드를 복사하고 엔터키를 누른다.

function ClickConnect(){
console.log("Working"); 
document.querySelector("colab-toolbar-button#connect").click() 
}
setInterval(ClickConnect,60000)

위의 코드는 10 분마나 스크린을 자동으로 클릭하여 colab이 멈추는 것을 방지하게 해 준다.

In [22]:
# 커스텀 detector를 학습시키기. 기존에 학습하다 말았으면 backup에 있는 weight를 불러서 학습하는 셀로 이동하기 !./darknet detector train data/obj.data cfg/yolov3_custom.cfg darknet53.conv.74 -dont_show
 CUDA-version: 10010 (10010), cuDNN: 7.6.5, GPU count: 1  
 OpenCV version: 3.2.0
yolov3_custom
 0 : compute_capability = 750, cudnn_half = 0, GPU: Tesla T4 
net.optimized_memory = 0 
mini_batch = 4, batch = 64, time_steps = 1, train = 1 
 10000: 0.144250, 0.151510 avg loss, 0.000010 rate, 4.605611 seconds, 640000 images, 0.131308 hours left
Saving weights to /mydrive/yolov3/backup//yolov3_custom_10000.weights
Saving weights to /mydrive/yolov3/backup//yolov3_custom_last.weights
Saving weights to /mydrive/yolov3/backup//yolov3_custom_final.weights
If you want to train from the beginning, then use flag in the end of training command: -clear 

Step 6: 커스텀 Object Detector 실행하기

커스텀 Object Detector가 만들어졌기 때문에 이제 실행을 하면 됨.

In [ ]:
# custom cfg 를 test mode 로 바꾸기 %cd cfg !sed -i 's/batch=64/batch=1/' yolov3_custom.cfg !sed -i 's/subdivisions=16/subdivisions=1/' yolov3_custom.cfg %cd ..
/content/darknet/cfg
/content/darknet
In [ ]:
# 구글 드라이브로 원하는 영상을 업로드한 후에 커스텀 detector를 돌리기. 여기서 -thresh 0.3은 Accuracy가 0.3이하가 되는 Object의 Bounding Box는 보이지 않게 하겠다는 뜻임 !./darknet detector test data/obj.data cfg/yolov3_custom.cfg /mydrive/yolov3/backup/yolov3_custom_last.weights /mydrive/images/test.jpg -thresh 0.3 imShow('predictions.jpg')
 CUDA-version: 10010 (10010), cuDNN: 7.6.5, GPU count: 1  
 OpenCV version: 3.2.0
 0 : compute_capability = 750, cudnn_half = 0, GPU: Tesla T4 
net.optimized_memory = 0 
mini_batch = 1, batch = 1, time_steps = 1, train = 0 
   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
  43 Shortcut Layer: 40,  wt = 0, wn = 0, outputs:  26 x  26 x 512 0.000 BF
  44 conv    256       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x 256 0.177 BF
  45 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  46 Shortcut Layer: 43,  wt = 0, wn = 0, outputs:  26 x  26 x 512 0.000 BF
  47 conv    256       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x 256 0.177 BF
  48 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  49 Shortcut Layer: 46,  wt = 0, wn = 0, outputs:  26 x  26 x 512 0.000 BF
  50 conv    256       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x 256 0.177 BF
  51 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  52 Shortcut Layer: 49,  wt = 0, wn = 0, outputs:  26 x  26 x 512 0.000 BF
  53 conv    256       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x 256 0.177 BF
  54 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  55 Shortcut Layer: 52,  wt = 0, wn = 0, outputs:  26 x  26 x 512 0.000 BF
  56 conv    256       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x 256 0.177 BF
  57 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  58 Shortcut Layer: 55,  wt = 0, wn = 0, outputs:  26 x  26 x 512 0.000 BF
  59 conv    256       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x 256 0.177 BF
  60 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  61 Shortcut Layer: 58,  wt = 0, wn = 0, outputs:  26 x  26 x 512 0.000 BF
  62 conv   1024       3 x 3/ 2     26 x  26 x 512 ->   13 x  13 x1024 1.595 BF
  63 conv    512       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x 512 0.177 BF
  64 conv   1024       3 x 3/ 1     13 x  13 x 512 ->   13 x  13 x1024 1.595 BF
  65 Shortcut Layer: 62,  wt = 0, wn = 0, outputs:  13 x  13 x1024 0.000 BF
  66 conv    512       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x 512 0.177 BF
  67 conv   1024       3 x 3/ 1     13 x  13 x 512 ->   13 x  13 x1024 1.595 BF
  68 Shortcut Layer: 65,  wt = 0, wn = 0, outputs:  13 x  13 x1024 0.000 BF
  69 conv    512       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x 512 0.177 BF
  70 conv   1024       3 x 3/ 1     13 x  13 x 512 ->   13 x  13 x1024 1.595 BF
  71 Shortcut Layer: 68,  wt = 0, wn = 0, outputs:  13 x  13 x1024 0.000 BF
  72 conv    512       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x 512 0.177 BF
  73 conv   1024       3 x 3/ 1     13 x  13 x 512 ->   13 x  13 x1024 1.595 BF
  74 Shortcut Layer: 71,  wt = 0, wn = 0, outputs:  13 x  13 x1024 0.000 BF
  75 conv    512       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x 512 0.177 BF
  76 conv   1024       3 x 3/ 1     13 x  13 x 512 ->   13 x  13 x1024 1.595 BF
  77 conv    512       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x 512 0.177 BF
  78 conv   1024       3 x 3/ 1     13 x  13 x 512 ->   13 x  13 x1024 1.595 BF
  79 conv     30       1 x 1/ 1     13 x  13 x1024 ->   13 x  13 x  30 0.010 BF
  80 conv     30       3 x 3/ 1     13 x  13 x  30 ->   13 x  13 x  30 0.003 BF
  81 conv     30       1 x 1/ 1     13 x  13 x  30 ->   13 x  13 x  30 0.000 BF
  82 yolo
[yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00
  83 route  79 		                           ->   13 x  13 x  30 
  84 conv    256       1 x 1/ 1     13 x  13 x  30 ->   13 x  13 x 256 0.003 BF
  85 upsample                 2x    13 x  13 x 256 ->   26 x  26 x 256
  86 route  85 61 	                           ->   26 x  26 x 768 
  87 conv    256       1 x 1/ 1     26 x  26 x 768 ->   26 x  26 x 256 0.266 BF
  88 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  89 conv    256       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x 256 0.177 BF
  90 conv    512       3 x 3/ 1     26 x  26 x 256 ->   26 x  26 x 512 1.595 BF
  91 conv     30       1 x 1/ 1     26 x  26 x 512 ->   26 x  26 x  30 0.021 BF
  92 conv     30       3 x 3/ 1     26 x  26 x  30 ->   26 x  26 x  30 0.011 BF
  93 conv     30       1 x 1/ 1     26 x  26 x  30 ->   26 x  26 x  30 0.001 BF
  94 yolo
[yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00
  95 route  91 		                           ->   26 x  26 x  30 
  96 conv    128       1 x 1/ 1     26 x  26 x  30 ->   26 x  26 x 128 0.005 BF
  97 upsample                 2x    26 x  26 x 128 ->   52 x  52 x 128
  98 route  97 36 	                           ->   52 x  52 x 384 
  99 conv    128       1 x 1/ 1     52 x  52 x 384 ->   52 x  52 x 128 0.266 BF
 100 conv    256       3 x 3/ 1     52 x  52 x 128 ->   52 x  52 x 256 1.595 BF
 101 conv    128       1 x 1/ 1     52 x  52 x 256 ->   52 x  52 x 128 0.177 BF
 102 conv    256       3 x 3/ 1     52 x  52 x 128 ->   52 x  52 x 256 1.595 BF
 103 conv     30       1 x 1/ 1     52 x  52 x 256 ->   52 x  52 x  30 0.042 BF
 104 conv     30       3 x 3/ 1     52 x  52 x  30 ->   52 x  52 x  30 0.044 BF
 105 conv     30       1 x 1/ 1     52 x  52 x  30 ->   52 x  52 x  30 0.005 BF
 106 yolo
[yolo] params: iou loss: mse (2), iou_norm: 0.75, obj_norm: 1.00, cls_norm: 1.00, delta_norm: 1.00, scale_x_y: 1.00
Total BFLOPS 60.000 
avg_outputs = 500337 
 Allocate additional workspace_size = 52.43 MB 
Loading weights from /mydrive/yolov3/backup/yolov3_custom_last.weights...
 seen 64, trained: 640 K-images (10 Kilo-batches_64) 
Done! Loaded 107 layers from weights-file 
 Detection layer: 82 - type = 28 
 Detection layer: 94 - type = 28 
 Detection layer: 106 - type = 28 
/mydrive/images/test.jpg: Predicted in 37.900000 milli-seconds.
Giraffe: 99%
Unable to init server: Could not connect: Connection refused

(predictions:272633): Gtk-WARNING **: 06:58:30.953: cannot open display: 
In [ ]:
imShow('predictions.jpg')

이 코드를 만든 AI Guy의 유튜브 링크:

The AI Guy

'BOOTCAMP > 프로그래머스 인공지능 데브코스' 카테고리의 다른 글

[18주차] 추천시스템 구현  (0) 2023.07.21
[17주차] GAN  (0) 2023.07.21
[15주차] NLP  (0) 2023.06.28
[14주차] Spark  (0) 2023.06.28
[13주차] monthly project3  (0) 2023.06.28