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.
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
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'