Open VYRION-Ai opened 2 years ago
https://github.com/WongKinYiu/yolor/blob/main/detect.py#L45
hmm... i think line 45 won't be run. do u modify the code?
https://github.com/WongKinYiu/yolor/blob/main/detect.py#L45
hmm... i think line 45 won't be run. do u modify the code?
yes i comment line 43 and 44 and remove comment from 45 ,
#model = Darknet(cfg, imgsz).cuda()
#model.load_state_dict(torch.load(weights[0], map_location=device)['model'])
model = attempt_load(weights, map_location=device) # load FP32 model
attemp_load is used for loading weights in paper branch.
attemp_load is used for loading weights in paper branch.
What I am doing, is i want to run the detect.py file on my laptop ( which don't have GPU) ,with my best.pt file , so i want to run it on CPU , that is why I do what I done
i try to detecting on local pc , put i got this error
File "detect.py", line 197, in
detect()
File "detect.py", line 45, in detect
model = attempt_load(weights, map_location=device) # load FP32 model
File "E:\Python\yolor-main\yolor-main\utils\google_utils.py", line 40, in attempt_load
model = Ensemble()
NameError: name 'Ensemble' is not defined