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
Can't add graph with pytorch v0.2 #9
Comments
Passing the variable directly to the model solved the problem. But I don't know why. XD import torch
import torch.nn as nn
from torch.autograd import Variable
from datetime import datetime
from tensorboard import SummaryWriter
model = nn.Linear(10, 10)
h = model(Variable(torch.rand(10, 10), requires_grad=True))
writer = SummaryWriter('runs/'+datetime.now().strftime('%B%d %H:%M:%S'))
writer.add_graph(model, h)
writer.close() |
in theory it shouldn't be possible to add a graph in v0.1.12, right? I tried with a nn.Sequential model and the result was the same. |
If your 0.1.12 is installed via pip then this function wont work. But if you build by yourself (0.1.12+xxxx) then it should work. Have you tried my solution? |
your solution works, but that shouldn't make any difference lol |
I found something..
and check using the debug the
The input is still an element of the tuple, but it has a |
I update my pytorch to version 0.3, but I got the same error after my update. Previously there is no problem. Here is my code:
Even using the simple code I still get the error:
|
That's expected behavior on v0.3. Please have a try on the onnx version: https://github.com/lanpa/tensorboard-pytorch/blob/master/onnx_graph.py |
Since v0.2 is legacy, closing this. |
I tried to run this snippet:
but I get this error message:
The text was updated successfully, but these errors were encountered: