waleedka / hiddenlayer

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

TypeError: zeros(): argument 'out' (position 2) must be Tensor, not list #28

Closed tphankr closed 5 years ago

tphankr commented 5 years ago

I want to visualizer a model with 3-input and have problem with feed 3-input. This model have three input, this filgure: image

I conferenced this ideal of Waleed (https://github.com/waleedka)and I visualier 3 patch with 3 input [ 32,6, 25, 25] [ 32,6, 51, 51],[32, 6, 75, 75] with code line:

hl.build_graph(model, torch.zeros([32,6, 25, 25], [32,6, 51, 51],[32, 6, 75, 75]))

1) But my code had the error: TypeError: zeros(): argument 'out' (position 2) must be Tensor, not list. How do I fix this problem? (I also tried many ways, example:

hl.build_graph(net, torch.zeros( 32,6, 25, 25), torch.zeros(32, 6, 51, 51), torch.zeros(32, 6, 75, 75))

hl.build_graph(net, torch.zeros(( 32,6, 25, 25), ( 32,6, 51, 51), ( 32,6, 75, 75)))

hl.build_graph(net, torch.zeros([( 32,6, 25, 25)],[( 32,6, 51, 51)],[( 32,6, 75, 75)])

)

In addition, I successed with the first path with code line: hl.build_graph(model, torch.zeros([32,6, 25, 25]). And had figure: image..................... 2) And question more about window size of model visualize. Can we show full model visualize one window or save it ? as we see these below picture, I must to stride many time in oder to take a my model.

image image

Thank you.

tphankr commented 5 years ago

I had a solution: input_1 = torch.zeros([......]) input_2 = torch.zeros([......]) hl.build_graph(..., (input1, input2, ...,input_n))

Thank you, all.

waleedka commented 5 years ago

Thanks for posting the answer. I'll close this issue then.