szagoruyko / pytorchviz

A small package to create visualizations of PyTorch execution graphs
MIT License
3.24k stars 279 forks source link

AttributeError: 'tuple' object has no attribute 'grad_fn' #10

Closed lzhaozi closed 6 years ago

lzhaozi commented 6 years ago

My env is python2.7+pytorch0.3.1. When I try this repo, I face the problem: AttributeError: 'tuple' object has no attribute 'grad_fn'

Does anybody know why? Is it because the pytorch version is not supported?

Germanunkol commented 6 years ago

You're probably not feeding a tensor/variable into the make_dot function? Make sure the output from your network is a variable (or tensor), then call make_dot with this result.