An error that stumbled upon learning YOLO on Google Colab

This article is a summary of errors that took a long time to resolve when learning YOLO on Google Colab. Many of them are rudimentary, but I hope you can overlook them.

Around the line feed code

./src/utils.c:256: error: Assertion `0' failed There seem to be various causes, but in my case it was because the line feed code of the .data file was CRLF. It was cured by changing to LF with a text editor. It took a long time to identify because there was no error when running in the Windows environment at hand.

STB Reason: can't fopen Cannot load image "data/images/xxx.jpg The cause was that the line feed code of train.txt and test.txt was CRLF. I used this procss.py to sort the training / test data. , It seems that it becomes CRLF without permission when it is executed on Windows, so I had to modify it a little. As you can see, it seems good to specify the line feed code with newline when opening the file.

file_train = open(path_data + 'train.txt', 'w',newline="\n")
file_test = open(path_data + 'test.txt', 'w',newline="\n")

Reference: The line feed code of the Python output file executed on Windows changes

Error due to insufficient memory

/bin/bash: line 1: 761 Killed The numbers change from time to time. By analogy with the solution, it seems to be an Out of memory error. YOLO processes the number of batch / subdivision specified in .cfg at a time (which is not accurate here), so for example, in the case of batch 64 subdivision 16, it processes 4 at a time. However, due to GPU performance etc., memory is insufficient and an error occurs. In this case, the value of subdivison should be increased sequentially. I finally got it running on batch 64 subdivison 64 and it no longer gives an error. Since it becomes a trade-off with the processing speed, it is necessary to adjust the value appropriately according to the data set.

Recommended Posts

An error that stumbled upon learning YOLO on Google Colab
Machine learning with Pytorch on Google Colab
I tried running YOLO v3 on Google Colab
About learning with google colab
Plotly Dash on Google Colab
Points that stumbled on GORM
Deep Learning with Shogi AI on Mac and Google Colab
Deep Learning with Shogi AI on Mac and Google Colab Chapter 11
Deep Learning with Shogi AI on Mac and Google Colab Chapters 1-6
Deep Learning with Shogi AI on Mac and Google Colab Chapter 8
Deep Learning with Shogi AI on Mac and Google Colab Chapter 12 3
Deep Learning with Shogi AI on Mac and Google Colab Chapter 7
Deep Learning with Shogi AI on Mac and Google Colab Chapter 10 6-9
Deep Learning with Shogi AI on Mac and Google Colab Chapter 7 5-7
Deep Learning with Shogi AI on Mac and Google Colab Chapter 9
Deep Learning with Shogi AI on Mac and Google Colab Chapter 12 3
Deep Learning with Shogi AI on Mac and Google Colab Chapter 12 3
Deep Learning with Shogi AI on Mac and Google Colab Chapter 12 1-2
Deep Learning with Shogi AI on Mac and Google Colab Chapter 12 3
Deep Learning with Shogi AI on Mac and Google Colab Chapter 12 3 ~ 5
Deep Learning with Shogi AI on Mac and Google Colab Chapter 7 9
Deep Learning with Shogi AI on Mac and Google Colab Chapter 8 5-9
Deep Learning with Shogi AI on Mac and Google Colab Chapter 8 1-4
Deep Learning with Shogi AI on Mac and Google Colab Chapter 12 3
Deep Learning with Shogi AI on Mac and Google Colab Chapter 7 8
Deep Learning with Shogi AI on Mac and Google Colab Chapter 7 1-4
Play with Turtle on Google Colab
What I did when I stumbled upon mounting on MyDrive and loading an ipynb file in Google Colaboratory
Learn with Shogi AI Deep Learning on Mac and Google Colab Use Google Colab
Deep Learning on Mac and Google Colab Words Learned with Shogi AI
A story that stumbled upon a comparison operation
I stumbled upon installing sentencepiece on ubuntu
Image segment using Oxford_iiit_pet on Google Colab
A memo that I stumbled upon when doing a quote RT on Twitter Bot