Closed Dominux closed 4 years ago
@Dominux that’s odd. Can you try the same command with the pytorch weights instead: yolov3-spp.pt
python detect.py --cfg cfg/yolov3.cfg --weights yolov3.weights
Namespace(agnostic_nms=False, cfg='cfg/yolov3.cfg', classes=None, conf_thres=0.3, device='', fourcc='mp4v', half=False, img_size=416, iou_thres=0.5,
names='data/coco.names', output='output', save_txt=False, source='data/samples', view_img=False, weights='yolov3.weights')
Using CUDA device0 _CudaDeviceProperties(name='GeForce MX230', total_memory=2048MB)
Traceback (most recent call last):
File "detect.py", line 179, in <module>
detect()
File "detect.py", line 28, in detect
load_darknet_weights(model, weights)
File "D:\My_scripts\Fashion is my profession\Projects versions\D\yolov3\models.py", line 363, in load_darknet_weights
conv_w = torch.from_numpy(weights[ptr:ptr + num_w]).view_as(conv_layer.weight)
RuntimeError: shape '[32, 3, 3, 3]' is invalid for input of size 255
@Dominux the .weights are darknet weights. .pt are pytorch weights. You might try re-running with pytorch weights, or running your code in a working envorionment:
you might want to try "weights/yolov3-spp.weights"
you might want to try "weights/yolov3-spp.weights"
It doesn't work
@Dominux it may just be a windows-related issue then. We routinely validate the code on MacOS and Linux, but our most recent Windows validation was several months ago. It's possible the changes since then may cause a problem on Windows.
Unfortunately we don't have a current Windows machine to test on, nor time to spin up a Windows VM, but if you discover the source of the issue please let us know.
@glenn-jocher do u know if I can run it from windows subsystem for linux?
@Dominux I'm not sure, but we do have various working linux environments available you can use and access from windows, many free. We will try to validate on windows at some point soon, but in general we highly recommend you try to develop under linux, even moreso for PyTorch CUDA and GPU accessibility and operability. https://docs.ultralytics.com/yolov5/tutorials/train_custom_data
To access an up-to-date working environment (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled), consider a:
I'll close this issue for now as the original issue appears to have been resolved, and/or no activity has been seen for some time. Feel free to comment if this is not the case.
I cloned repo and ran:
python detect.py --cfg cfg/yolov3-spp.cfg --weights yolov3-spp.weights
And got that:
I have:
Any idea?