kriyeng / yolo-on-colab-notebook Goto Github PK
View Code? Open in Web Editor NEWHow to train YOLOv3 using Darknet on Colab 12GB-RAM GPU notebook and optimize the VM runtime load times
How to train YOLOv3 using Darknet on Colab 12GB-RAM GPU notebook and optimize the VM runtime load times
Hi.
I am using colab to train darknet. When I run the detector command, it is not able to read the path to train.txt file because it has white spaces in it. I tried using "Shared\ drives" as well, but it is still not working. It would be really helpful if you could help me solve this issue.
Thanks.
Error : Loading weights from darknet53.conv.74...Done!
Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005
Couldn't open file: /content/drive/Shared\drives/darknet/train.txt
I've tried numerous times to compile Darknet. It can clone but never is able to fully compiled. I saw darknet files created under content but could never copy it over the google drive. "cp: cannot stat './darknet': No such file or directory"
I would really appreciate anybody's help on this! Qifang
Cloning into 'darknet'...
remote: Enumerating objects: 10068, done.
remote: Total 10068 (delta 0), reused 0 (delta 0), pack-reused 10068
Receiving objects: 100% (10068/10068), 10.15 MiB | 10.53 MiB/s, done.
Resolving deltas: 100% (6732/6732), done.
/content/darknet/darknet
3rdparty CMakeLists.txt image_yolov3.sh scripts
appveyor.yml CMakeSettings.json include src
build DarknetConfig.cmake.in json_mjpeg_streams.sh video_v2.sh
build.ps1 darknet.py LICENSE video_yolov3.sh
build.sh darknet_video.py Makefile
cfg data net_cam_v3.sh
cmake image_yolov2.sh README.md
Branch 'feature/google-colab' set up to track remote branch 'feature/google-colab' from 'origin'.
Switched to a new branch 'feature/google-colab'
mkdir -p obj
mkdir -p backup
mkdir -p results
chmod +x .sh
g++ -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV 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(mat_cv, detection*, int, float, char**, image**, int, int)’:
./src/image_opencv.cpp:896:23: warning: variable ‘rgb’ set but not used [-Wunused-but-set-variable]
float rgb[3];
^~~
g++ -std=c++11 -Iinclude/ -I3rdparty/stb/include -DOPENCV 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
./src/http_stream.cpp: In member function ‘bool JSON_sender::write(const char*)’:
./src/http_stream.cpp:228: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:475:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (n < outlen)
~~^~~~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV 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:2016: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:2015: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 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
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV 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 ‘get_cuda_stream’:
./src/dark_cuda.c:120:18: warning: unused variable ‘buffer’ [-Wunused-variable]
char buffer[256];
^~~~~~
./src/dark_cuda.c: In function ‘get_cuda_memcpy_stream’:
./src/dark_cuda.c:141:18: warning: unused variable ‘buffer’ [-Wunused-variable]
char buffer[256];
^~~~~~
./src/dark_cuda.c: In function ‘cudnn_handle’:
./src/dark_cuda.c:161:23: warning: unused variable ‘status’ [-Wunused-variable]
cudnnStatus_t status = cudnnSetStream(handle[i], get_cuda_stream());
^~~~~~
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV 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:277:24: error: ‘CUDNN_CONVOLUTION_FWD_PREFER_FASTEST’ undeclared (first use in this function); did you mean ‘CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3’?
int forward_algo = CUDNN_CONVOLUTION_FWD_PREFER_FASTEST;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CUDNN_CONVOLUTION_BWD_FILTER_ALGO_3
compilation terminated due to -Wfatal-errors.
Makefile:146: recipe for target 'obj/convolutional_layer.o' failed
make: *** [obj/convolutional_layer.o] Error 1
cp: cannot stat './darknet': No such file or directory
I'm trying to train YOLO, but when 100 iterations reached, this message shows:
Can't save to '/content/gdrive/My\Drive/darknet/backup/yolov3-last.weights'
As you can see, the space is deleted but in my data file I set backup like this:
backup = /content/gdrive/My\ Drive/darknet/backup/yolov3-last.weights
NOTE: now I'm saving the backups to colab and manually downloading them
As mentioned
of course on Colab with local webcam !
Thank you !
I am a mac user and trying to follow your guide to train yolov3 with my dataset.
I face a problem during installing cuDNN. I used exactly the same code as below.
!tar -xzvf gdrive/My\ Drive/darknet/cuDNN/cudnn-10.0-linux-x64-v7.5.0.56.tar -C /usr/local/
!chmod a+r /usr/local/cuda/include/cudnn.h
Then I got an Error:
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
chmod: cannot access '/usr/local/cuda/include/cudnn.h': No such file or directory
How could I fix this problem?
Hello! Is it possible to fit the network on my own class of objects or is it necessary to train from scratch here?
In short
This doesn't work (trying to use detector test on multiple images in a folder:
!./darknet detector test "/content/gdrive/My Drive/darknet/obj.data" "/content/gdrive/My Drive/darknet/cfg/yolov3.cfg" "/content/gdrive/My Drive/darknet/backup/yolov3_final.weights" -dont_show < "/content/gdrive/My Drive/darknet/test.txt"> "/content/gdrive/My Drive/darknet/result.txt"
Error messege is:
Cannot load image /content/gdrive/My Drive/darknet/imgTest/test4.jpg
Cannot load image /content/gdrive/My Drive/darknet/imgTest/test3.jpg
This does work (detect on one image, using direct path to said image):
!./darknet detector test "/content/gdrive/My Drive/darknet/obj.data" "/content/gdrive/My Drive/darknet/cfg/yolov3.cfg" "/content/gdrive/My Drive/darknet/backup/yolov3_final.weights" -dont_show "/content/gdrive/My Drive/darknet/imgTest/test4.jpg" "/content/gdrive/My Drive/darknet/result.txt"
The test.txt file consist of the same path as given in working detector test i.e.:
/content/gdrive/My Drive/darknet/imgTest/test4.jpg
No spaces or blank lines in it apart from My Drive.
All help is very much appriciated
test.txt file linked:
test.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.