szagoruyko / pytorchviz

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

how about an example that triggers fillcolor='orange' in dot.py? #11

Closed mepster closed 6 years ago

mepster commented 6 years ago

In dot.py there is a case in which a node will be plotted with fillcolor='orange'. However, none of the example networks in examples.ipynb show orange boxes - only blue and gray. Under what conditions are you supposed to get orange boxes? Can you tweak one of the example networks to illustrate this?

I've been playing with the code in dot.py, but I haven't been able to define a network that produces orange boxes... I don't think "torch.is_tensor(var)" ever evaluates to true... at least in no network I could come up with. (However, "torch.is_tensor(var.variable)" does sometimes evaluate true.)

Thanks! (Very useful tool!)

YoelShoshan commented 6 years ago

There is a visualization example which seems to show those "orange nodes", which are pretty important, because , for example, they show activation tensor sizes which are helpful in visualizing how your network looks like.

https://github.com/szagoruyko/functional-zoo/blob/master/resnet-18-export.ipynb

However, I think that autograd changes between pytorch 0.3 and 0.4 broke that path.

YoelShoshan commented 6 years ago

Ok, there's an official answer about this question:

https://discuss.pytorch.org/t/traversing-computation-graph-and-seeing-saved-tensors-problem-edited-hopefuly-clearer/20575

szagoruyko commented 6 years ago

right, not possible without internal changes to pytorch, closing.