由于墙的存在,默认调用
yolov5 = torch.hub.load('ultralytics/yolov5', 'custom', path='F:\\GitHub\\yolov5\\runs\\train\exp20\\weights\\best.pt',device='0')
时常报错:
urllib.error.URLError:
1.将GitHub - ultralytics/yolov5: YOLOv5 in PyTorch > ONNX > CoreML > TFLitegitclone到本地
2.使用代码
yolov5 = torch.hub.load('F:\\GitHub\\yolov5', 'custom', path='F:\\GitHub\\yolov5\\runs\\train\exp20\\weights\\best.pt', source='local',device='0')
参考说明:PyTorch Hub - YOLOv5 Documentation