waleedka / hiddenlayer

Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.
MIT License
1.79k stars 266 forks source link

shape error #14

Closed kleinzcy closed 5 years ago

kleinzcy commented 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

Thanks.

waleedka commented 5 years ago

Make sure you feel the correct input size (the torch.zeros(....) in your example). I don't think DarkNet takes 224x224 images.

kleinzcy commented 5 years ago

I solved it.

Thank you for answering my question late at night.