I have tried all of the answers that reference "exit code -1073741819 (0xC0000005)" (Which means access violation) but none of them work. I followed the exact instructions on the Ultraytics web site on another machine and it works fine, but the machine I must do the work on give me the access violation. The code from the site is:
import torch
# Model
model = torch.hub.load('ultralytics/yolov5', 'yolov5s') # or yolov5m, yolov5l, yolov5x, custom
# Images
img = 'https://ultralytics.com/images/zidane.jpg' # or file, Path, PIL, OpenCV, numpy, list
# Inference
results = model(img)
# Results
results.print() # or .show(), .save(), .crop(), .pandas(), etc.
When I debug it I never get past the torch.hub.load statement.
I've tried (1) various version of Python 3.6 - 3.10, (2) reinstalling Yolov5, (3) Virtual environments. I think it may be related to privileges on this machine but I'm not sure where to look.