How to train yolov4 model using your own custom dataset in tensorflowlite(real-time)? anyone can help me?
Hi sir thank you for your response. Is it okay to follow that article when i have a 4 objects such as bottle,wrapper,plastic,can needed to train and detect using in that article?
Hi sir can u help me when i run this line i get error
install environment from the Makefile. Changes to mitigate CUDA error.
%cd darknet/
!sed -i âs/OPENCV=0/OPENCV=1/gâ Makefile
!sed -i âs/GPU=0/GPU=1/gâ Makefile
!sed -i âs/CUDNN=0/CUDNN=1/gâ Makefile
!sed -i âs/ARCH= -gencode arch=compute_60,code=sm_60/ARCH= -gencode arch=compute_${compute_capability},code=sm_${compute_capability}/gâ Makefile
!make
and this the error /content/darknet
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:910:23: warning: variable ârgbâ set but not used [-Wunused-but-set-variable]
910 | float rgb[3];
| ^~~
./src/image_opencv.cpp: In function âvoid cv_draw_object(image, float*, int, int, int*, float*, int*, int, char**)â:
./src/image_opencv.cpp:1391:14: warning: unused variable âbuffâ [-Wunused-variable]
1391 | char buff[100];
| ^~~~
./src/image_opencv.cpp:1367:9: warning: unused variable âit_tb_resâ [-Wunused-variable]
1367 | int it_tb_res = cv::createTrackbar(it_trackbar_name, window_name, &it_trackbar_value, 1000);
| ^~~~~~~~~
./src/image_opencv.cpp:1371:9: warning: unused variable âlr_tb_resâ [-Wunused-variable]
1371 | int lr_tb_res = cv::createTrackbar(lr_trackbar_name, window_name, &lr_trackbar_value, 20);
| ^~~~~~~~~
./src/image_opencv.cpp:1375:9: warning: unused variable âcl_tb_resâ [-Wunused-variable]
1375 | int cl_tb_res = cv::createTrackbar(cl_trackbar_name, window_name, &cl_trackbar_value, classes-1);
| ^~~~~~~~~
./src/image_opencv.cpp:1378:9: warning: unused variable âbo_tb_resâ [-Wunused-variable]
1378 | 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:
./src/httplib.h:129: warning: âINVALID_SOCKETâ redefined
129 | #define INVALID_SOCKET (-1)
|
./src/http_stream.cpp:73: note: this is the location of the previous definition
73 | #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]
249 | 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:95: warning: format â%zuâ expects argument of type âsize_tâ, but argument 3 has type âintâ [-Wformat=]
507 | sprintf(head, ââmjpegstream\r\nContent-Type: image/jpeg\r\nContent-Length: %zu\r\n\r\nâ, outlen);
| ^ ~~~~~~~~
| | |
| | int
| long unsigned int
| %u
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:2039:15: warning: unused variable âout_wâ [-Wunused-variable]
2039 | const int out_w = (w + 2 * pad - ksize) / stride + 1; // output_width=input_width for stride=1 and pad=1
| ^
./src/gemm.c:2038:15: warning: unused variable âout_hâ [-Wunused-variable]
2038 | 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
In file included from /usr/include/string.h:495,
from include/darknet.h:14,
from ./src/utils.h:3,
from ./src/utils.c:4:
In function âstrncpyâ,
inlined from âcopy_stringâ at ./src/utils.c:509:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: warning: â__builtin_strncpyâ specified bound depends on the length of the source argument [-Wstringop-overflow=]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./src/utils.c: In function âcopy_stringâ:
./src/utils.c:509:22: note: length computed here
509 | strncpy(copy, s, strlen(s)+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/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 â [-Wenum-compare]
224 | 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=]
276 | printf(âpre_allocate: size = %Iu MB, num_of_blocks = %Iu, block_size = %Iu MB \nâ,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| unsigned int
| %Ilu
277 | size / (10241024), num_of_blocks, pinned_block_size / (1024 * 1024));
| ~~~~~~~~~~~~~~~~~~
| |
| long unsigned int
./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=]
276 | printf(âpre_allocate: size = %Iu MB, num_of_blocks = %Iu, block_size = %Iu MB \nâ,
| ~~^
| |
| unsigned int
| %Ilu
277 | size / (10241024), num_of_blocks, pinned_block_size / (1024 * 1024));
| ~~~~~~~~~~~~~
| |
| size_t {aka const long unsigned int}
./src/dark_cuda.c:276:82: warning: format â%uâ expects argument of type âunsigned intâ, but argument 4 has type âlong unsigned intâ [-Wformat=]
276 | printf(âpre_allocate: size = %Iu MB, num_of_blocks = %Iu, block_size = %Iu MB \nâ,
| ^
| |
| unsigned int
| %Ilu
277 | size / (1024*1024), num_of_blocks, pinned_block_size / (1024 * 1024));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| long unsigned int
./src/dark_cuda.c:286:37: warning: format â%dâ expects argument of type âintâ, but argument 2 has type âlong unsigned intâ [-Wformat=]
286 | printf(" Allocated %d pinned block \n", pinned_block_size);
| ~^ ~~~~~~~~~~~~~~~~~
| | |
| int long unsigned int
| %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=]
307 | printf(â\n Pinned block_id = %d, filled = %f %% \nâ, pinned_block_id, filled);
| ~^ ~~~~~~~~~~~~~~~
| | |
| int size_t {aka long unsigned int}
| %ld
./src/dark_cuda.c:322:64: warning: format â%dâ expects argument of type âintâ, but argument 2 has type âlong unsigned intâ [-Wformat=]
322 | printf(âTry to allocate new pinned memory, size = %d MB \nâ, size / (1024 * 1024));
| ~^ ~~~~~~~~~~~~~~~~~~~~
| | |
| int long unsigned int
| %ld
./src/dark_cuda.c:328:63: warning: format â%dâ expects argument of type âintâ, but argument 2 has type âlong unsigned intâ [-Wformat=]
328 | printf(âTry to allocate new pinned BLOCK, size = %d MB \nâ, size / (1024 * 1024));
| ~^ ~~~~~~~~~~~~~~~~~~~~
| | |
| int long unsigned int
| %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 âcudnn_convolutional_setupâ:
./src/convolutional_layer.c:286:24: error: âCUDNN_CONVOLUTION_FWD_PREFER_FASTESTâ undeclared (first use in this function); did you mean âCUDNN_CONVOLUTION_BWD_FILTER_ALGO_3â?
286 | int forward_algo = CUDNN_CONVOLUTION_FWD_PREFER_FASTEST;
| ^
| CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3
compilation terminated due to -Wfatal-errors.
make: *** [Makefile:162: obj/convolutional_layer.o] Error 1
Please refer to the below comment
http://discuss.ai.google.dev/t/error-making-make-using-darknet/14908/3?u=chunduriv
okay sir. any tips also on how to train custom object detection using tensorflow lite model makef sir? using also yolov4 sir?
Unfortunately at the moment we donât have support for yolo
using tensorflow lite model maker. Please refer to the below comment on supported models
http://discuss.ai.google.dev/t/model-spec-architecture-and-the-names-to-use/4999/3?u=chunduriv
Thanks!
sir can i ask if what OBJECT_DETECTION_MODELS
i will use in order to use it for detecting this (bottle, can, plastic, wrapper) because i made a dataset in roboflow. and my classes are 4, how many batch_size and epochs do i need to set?