Closed kleinzcy closed 5 years ago
Hi, I met a problem when I want to visualize the darknet:
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") print("device = ", device) model = Darknet("yolo/cfg/yolov3.cfg").to(device) hl.build_graph(model, torch.zeros([1, 3, 224, 224]).to(device)) RuntimeError: shape '[1, 255, 841]' is invalid for input of size 199920
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print("device = ", device)
model = Darknet("yolo/cfg/yolov3.cfg").to(device)
hl.build_graph(model, torch.zeros([1, 3, 224, 224]).to(device))
RuntimeError: shape '[1, 255, 841]' is invalid for input of size 199920
Thanks.
Make sure you feel the correct input size (the torch.zeros(....) in your example). I don't think DarkNet takes 224x224 images.
I solved it.
Thank you for answering my question late at night.
Hi, I met a problem when I want to visualize the darknet:
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print("device = ", device)
model = Darknet("yolo/cfg/yolov3.cfg").to(device)
hl.build_graph(model, torch.zeros([1, 3, 224, 224]).to(device))
RuntimeError: shape '[1, 255, 841]' is invalid for input of size 199920
Thanks.