[yolov5] An error occurred in the yolov5 training model

When training your own data set, you need to correctly fill in the path of the training set and verification set under the yaml file.
insert image description here
The following error occurs when training with the following statement:

python train.py --batch-size 2 --epoch 200 --data data/leaf/data.yaml --weights .\yolov5s.pt

insert image description here

Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

This problem is usually caused by multiple threads calling OpenMP libraries (such as libiomp5md.dll) at the same time. Generally speaking, this problem can be solved by setting the environment variable KMP_DUPLICATE_LIB_OK to TRUE, which allows the library to be loaded repeatedly, thereby avoiding this problem.

Insert the following code in the train.py file to solve it:

import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'

insert image description here

Guess you like

Origin blog.csdn.net/qq_44878985/article/details/129656030