Hi, I faced this exact issue and appear to have got it working by checking out an older version of the yolov5 repo, this one worked for me -
Also in detector.py the line
model = attempt_load(weights, map_location=device)
needs to be changed to
model = attempt_load(weights, device=device)
This post was helpful for finding that out - 关于“TypeError: attempt_load() got an unexpected keyword argument 'map_location'” · Issue #8178 · ultralytics/yolov5 · GitHub
hope this helps
1 Like