命令行执行YOLO训练命令报错:1.PermissionError: [WinError 5] 拒绝访问 2.OMP: Error#15: Initializing libiomp5md.dll...

今天想用yolov8来训练一下自己的数据集,按照步骤调试好之后,执行

yolo train data=ultralytics/cfg/datasets/data.yaml model=yolov8x.pt epochs=10 lr0=0.01 batch=4

出现两个报错

1. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

2. PermissionError: [WinError 5] 拒绝访问。

解决方法:

1. 对于第一个报错

OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

是由于这是因为多个 libiomp5md.dll 版本被加载到同一进程中。通常是由于 PyTorch 和其他库(如 NumPy、Scipy)同时使用 OpenMP 导致的。

为什么会有多个libiomp5md.dll文件呢,因为我用于训练的Anaconda的虚拟环境以前训练过其他的项目。

所以我在D:\SelfDownload\Anaconda\envs\test\Lib\site-packages\t

(yolo) PS F:\YOLO\ultralytics-main> yolo detect train data=datasets/sign/sign.yaml model=yolov8n.yaml pretrained=ultralytics/yolov8n.pt epochs=200 batch=8 lr0=0.01 resume=True device=0 Transferred 355/355 items from pretrained weights Ultralytics 8.3.162 Python-3.12.11 torch-2.7.1+cu118 CUDA:0 (NVIDIA GeForce GTX 1050, 2048MiB) engine\trainer: agnostic_nms=False, amp=True, augment=False, auto_augment=randaugment, batch=8, bgr=0.0, box=7.5, cache=False, cfg=None, classes=None, close_mosaic=10, cls=0.5, conf=None, copy_paste=0.0, copy_paste_mode=flip, cos_lr=False, cutmix=0.0, data=datasets/sign/sign.yaml, degrees=0.0, deterministic=True, device=0, dfl=1.5, dn n=False, dropout=0.0, dynamic=False, embed=None, epochs=200, erasing=0.4, exist_ok=False, fliplr=0.5, flipud=0.0, format=torchscript, fraction=1.0, freeze=None, half=Fa lse, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, imgsz=640, int8=False, iou=0.7, keras=False, kobj=1.0, line_width=None, lr0=0.01, lrf=0.01, mask_ratio=4, max_det=300, mixup=0.0 , mode=train, model=yolov8n.yaml, momentum=0.937, mosaic=1.0, multi_scale=False, name=train19, nbs=64, nms=False, opset=None, optimize=False, optimizer=auto, overlap_ma sk=True, patience=100, perspective=0.0, plots=True, pose=12.0, pretrained=ultralytics/yolov8n.pt, profile=False, project=None, rect=False, resume=None, retina_masks=Fal se, save=True, save_conf=False, save_crop=False, save_dir=runs\detect\train19, save_frames=False, save_json=False, save_period=-1, save_txt=False, scale=0.5, seed=0, sh ear=0.0, show=False, show_boxes=True, show_conf=True, show_labels=True, simplify=True, single_cls=False, source=None, split=val, stream_buffer=False, task=detect, time= None, tracker=botsort.yaml, translate=0.1, val=True, verbose=True, vid_stride=1, visualize=False, warmup_bias_lr=0.1, warmup_epochs=3.0, warmup_momentum=0.8, weight_decay=0.0005, workers=8, workspace=None Overriding model.yaml nc=80 with nc=2 from n params module arguments 0 -1 1 464 ultralytics.nn.modules.conv.Conv [3, 16, 3, 2] 1 -1 1 4672 ultralytics.nn.modules.conv.Conv [16, 32, 3, 2] 2 -1 1 7360 ultralytics.nn.modules.block.C2f [32, 32, 1, True] 3 -1 1 18560 ultralytics.nn.modules.conv.Conv [32, 64, 3, 2] 4 -1 2 49664 ultralytics.nn.modules.block.C2f [64, 64, 2, True] 5 -1 1 73984 ultralytics.nn.modules.conv.Conv [64, 128, 3, 2] 6 -1 2 197632 ultralytics.nn.modules.block.C2f [128, 128, 2, True] 7 -1 1 295424 ultralytics.nn.modules.conv.Conv [128, 256, 3, 2] 8 -1 1 460288 ultralytics.nn.modules.block.C2f [256, 256, 1, True] 9 -1 1 164608 ultralytics.nn.modules.block.SPPF [256, 256, 5] 10 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 11 [-1, 6] 1 0 ultralytics.nn.modules.conv.Concat [1] 12 -1 1 148224 ultralytics.nn.modules.block.C2f [384, 128, 1] 13 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest'] 14 [-1, 4] 1 0 ultralytics.nn.modules.conv.Concat [1] 15 -1 1 37248 ultralytics.nn.modules.block.C2f [192, 64, 1] 16 -1 1 36992 ultralytics.nn.modules.conv.Conv [64, 64, 3, 2] 17 [-1, 12] 1 0 ultralytics.nn.modules.conv.Concat [1] 18 -1 1 123648 ultralytics.nn.modules.block.C2f [192, 128, 1] 19 -1 1 147712 ultralytics.nn.modules.conv.Conv [128, 128, 3, 2] 20 [-1, 9] 1 0 ultralytics.nn.modules.conv.Concat [1] 21 -1 1 493056 ultralytics.nn.modules.block.C2f [384, 256, 1] 22 [15, 18, 21] 1 751702 ultralytics.nn.modules.head.Detect [2, [64, 128, 256]] YOLOv8n summary: 129 layers, 3,011,238 parameters, 3,011,222 gradients, 8.2 GFLOPs Transferred 319/355 items from pretrained weights Freezing layer 'model.22.dfl.conv.weight' AMP: running Automatic Mixed Precision (AMP) checks... Downloading https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11n.pt to 'yolo11n.pt'... 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5.35M/5.35M [00:01<00:00, 4.45MB/s] AMP: checks passed train: Fast image access (ping: 3.06.0 ms, read: 90.38.8 MB/s, size: 7468.0 KB) train: Scanning F:\YOLO\ultralytics-main\datasets\sign\labels\train2025.cache... 20 images, 4 backgrounds, 0 corrupt: 100%|██████████| 24/24 [00:00<?, ?it/s] val: Fast image access (ping: 0.10.0 ms, read: 416.7707.1 MB/s, size: 7252.3 KB) val: Scanning F:\YOLO\ultralytics-main\datasets\sign\labels\train2025.cache... 20 images, 4 backgrounds, 0 corrupt: 100%|██████████| 24/24 [00:00<?, ?it/s] OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrec t results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrec t results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrec t results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrec t results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. Plotting labels to runs\detect\train19\labels.jpg... OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrec t results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, please see http://www.intel.com/software/products/support/. (yolo) PS F:\YOLO\ultralytics-main> Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 122, in spawn_main exitcode = _main(fd, parent_sentinel) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 132, in _main self = reduction.pickle.load(from_parent) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\connection.py", line 1167, in rebuild_pipe_connection handle = dh.detach() ^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\reduction.py", line 131, in detach return _winapi.DuplicateHandle( ^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [WinError 5] 拒绝访问。 Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 122, in spawn_main exitcode = _main(fd, parent_sentinel) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 132, in _main self = reduction.pickle.load(from_parent) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\connection.py", line 1167, in rebuild_pipe_connection handle = dh.detach() ^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\reduction.py", line 131, in detach return _winapi.DuplicateHandle( ^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [WinError 5] 拒绝访问。 Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 122, in spawn_main exitcode = _main(fd, parent_sentinel) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 132, in _main self = reduction.pickle.load(from_parent) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\connection.py", line 1167, in rebuild_pipe_connection handle = dh.detach() ^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\reduction.py", line 131, in detach return _winapi.DuplicateHandle( ^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [WinError 5] 拒绝访问。 Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 122, in spawn_main exitcode = _main(fd, parent_sentinel) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\spawn.py", line 132, in _main self = reduction.pickle.load(from_parent) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\connection.py", line 1167, in rebuild_pipe_connection handle = dh.detach() ^^^^^^^^^^^ File "D:\miniconda3\envs\yolo\Lib\multiprocessing\reduction.py", line 131, in detach return _winapi.DuplicateHandle( ^^^^^^^^^^^^^^^^^^^^^^^^ PermissionError: [WinError 5] 拒绝访问
最新发布
07-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值