代码:
from ultralytics import YOLO
# Load a model
model = YOLO("yolov8m.yaml") # build a new model from scratch
# Use the model
results = model.predict(source="0", show=True, stream=True, classes=0, device='0')
model.train(data="conf.yaml", epochs=20, imgsz=600, device=' 0') # train the model
错误
Eror:NotImplementedError: Could not run 'torchvision::nms' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'torchvision::nms' is only available for these backends: [CPU, QuantizedCPU, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastCUDA, FuncTorchBatched, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PythonDispatcher].
File "C:\Users\pogti\Downloads\dataset_rust_ai\main.py", line 9, in <module>
model.train(data="conf.yaml", epochs=20, imgsz=600, device=' 0') # train the model
如果我做下面的,我得到:True
import torch
print(torch.cuda.is_available())
1条答案
按热度按时间kmb7vmvb1#
所有好我删除CUDA和安装。和所有的工作,如果SOEM需要我的代码:来自ultralytics import YOLO
ifname== 'main':