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

add_graph error #636

Open
Weipeilang opened this issue Jul 23, 2021 · 3 comments
Open

add_graph error #636

Weipeilang opened this issue Jul 23, 2021 · 3 comments

Comments

@Weipeilang
Copy link

When I'm using Add_ Graph, This error has occurred in the system
`import torch
import torch.nn as nn
from tensorboardX import SummaryWriter

class LeNet(nn.Module):
def init(self):
super(LeNet, self).init()
self.conv1 = nn.Sequential( # input_size=(12828)
nn.Conv2d(1, 6, 5, 1, 2),
nn.ReLU(), # (62828)
nn.MaxPool2d(kernel_size=2, stride=2), # output_size=(61414)
)
self.conv2 = nn.Sequential(
nn.Conv2d(6, 16, 5),
nn.ReLU(), # (161010)
nn.MaxPool2d(2, 2) # output_size=(1655)
)
self.fc1 = nn.Sequential(
nn.Linear(16 * 5 * 5, 120),
nn.ReLU()
)
self.fc2 = nn.Sequential(
nn.Linear(120, 84),
nn.ReLU()
)
self.fc3 = nn.Linear(84, 10)

def forward(self, x):
    x = self.conv1(x)
    x = self.conv2(x)
    x = x.view(x.size()[0], -1)
    x = self.fc1(x)
    x = self.fc2(x)
    x = self.fc3(x)
    return x

dummy_input = torch.rand(13, 1, 28, 28)
model = LeNet()
with SummaryWriter(comment='LeNet') as w:
w.add_graph(model, (dummy_input,))`

My environment is as follows:
tensorboard 2.5.0
tensorboard-data-server 0.6.1
tensorboard-plugin-wit 1.8.0
tensorboardX 2.4
tensorflow-estimator 2.5.0
torch 1.8.0
torchvision 0.9.0

The error is as follows:
Traceback (most recent call last):
File "D:/RoutineWork/python/Tensorboard/tensorboard.py", line 404, in
w.add_graph(model, (dummy_input,))
File "D:\Anaconda\envs\python37\lib\site-packages\tensorboardX\writer.py", line 944, in add_graph
from torch.utils.tensorboard.pytorch_graph import graph
File "D:\Anaconda\envs\python37\lib\site-packages\torch\utils\tensorboard_init
.py", line 1, in
import tensorboard
File "D:\RoutineWork\python\Tensorboard\tensorboard.py", line 404, in
w.add_graph(model, (dummy_input,))
File "D:\Anaconda\envs\python37\lib\site-packages\tensorboardX\writer.py", line 944, in add_graph
from torch.utils.tensorboard._pytorch_graph import graph
File "D:\Anaconda\envs\python37\lib\site-packages\torch\utils\tensorboard_pytorch_graph.py", line 4, in
from tensorboard.compat.proto.config_pb2 import RunMetadata
ModuleNotFoundError: No module named 'tensorboard.compat'; 'tensorboard' is not a package

Process finished with exit code 1

Thank you!

@lanpa
Copy link
Owner

lanpa commented Jul 25, 2021

Hi, can you try from tensorboard.compat.proto.config_pb2 import RunMetadata and check if there is any error?

@manjaro-git
Copy link

Did you resolve that? l have the same problem

@lanpa
Copy link
Owner

lanpa commented Dec 4, 2021

@manjaro-git What is your environment?

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

3 participants