Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No text label displayed on Google Colab (Pytorch 1.8.1) #58

Open
makaishi2 opened this issue Apr 3, 2021 · 1 comment
Open

No text label displayed on Google Colab (Pytorch 1.8.1) #58

makaishi2 opened this issue Apr 3, 2021 · 1 comment

Comments

@makaishi2
Copy link

I run following sample code on both local anaconda and google colab.
And on google colab no text label dispkayed on a result node.

Sample Code:

import torch
from torchviz import make_dot
print(torch.__version__)
x_np = np.arange(-2, 2.1, 0.25)
x = torch.tensor(x_np, requires_grad=True)
y = 2 * x**2 + 2
z = y.sum()
params = dict(x = x)
make_dot(z, params=params)

Result 1 (local anaconda pytorch 1.7.1)
スクリーンショット 2021-04-03 13 08 54

Result 2 (Google Colab pytorch 1.8.1)
スクリーンショット 2021-04-03 13 09 15

@albanD
Copy link
Contributor

albanD commented Apr 6, 2021

Hi,

As mentioned in the doc here:

- Green: tensor passed in as outputs

The green node is the Tensor passed as output. The () is its size.
You can pass z=z to the params dict and that name will be displayed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants