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

Has anyone use tensorboardX to visualize network structure? Some problem about the process of visualizing. #49

Open
chr10003566 opened this issue Apr 16, 2019 · 1 comment

Comments

@chr10003566
Copy link

I want to visualize the M2Det network, using the following code.

from configs.CC import Config
from layers.functions import Detect, PriorBox
from m2det import build_net
from tensorboardX import SummaryWriter
from torch.autograd import Variable
from utils.core import *

cfg = Config.fromfile('configs/m2det512_vgg.py')
net = build_net('test',
                size = cfg.model.input_size,
                config = cfg.model.m2det_config)
dummy_input = torch.rand(13, 3, 512, 512)
with SummaryWriter(comment='M2Det') as w:
   w.add_graph(net, (dummy_input, ))

It would raise the error TypeError: conv2d(): argument 'input' (position 1) must be Tensor, not tuple

but when I change the last line to
w.add_graph(net, dummy_input)

it would raise ValueError: Auto nesting doesn't know how to process an input object of type str. Accepted types: Tensors, or lists/tuples of them

Anyone have the experience to visualize the network structure? Please help me , Thx

@chr10003566 chr10003566 changed the title Has anyone use tensorboardX visualized network structure? Some problem about the process of visualizing. Has anyone use tensorboardX to visualize network structure? Some problem about the process of visualizing. Apr 16, 2019
@YongshengDong
Copy link

hi, You can modify some codes in m2det.py to solve this problem.
From:
self.leach = nn.ModuleList([BasicConv(
deep_out+shallow_out,
self.planes//2,
kernel_size=(1, 1), stride=(1, 1))]*self.num_levels)
To:
self.leach = nn.ModuleList([BasicConv(
deep_out+shallow_out,
self.planes//2,
kernel_size=(1, 1), stride=(1, 1)) for _ in range(self.num_levels)])

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