amdegroot / ssd.pytorch

A PyTorch Implementation of Single Shot MultiBox Detector
MIT License
5.13k stars 1.74k forks source link

How to visualize SSD graph? #167

Open agnonchik opened 6 years ago

agnonchik commented 6 years ago

Which tool did you use to plot SSD.jpg? I want to replot it with higher resolution to make the text readable.

Cathynuo commented 6 years ago

Maybe you could use the python file draw_net.py under the caffe/python/ to plot ssd architecture.

agnonchik commented 6 years ago

@Cathynuo Thanks for your suggestion. I know this tool. I just wonder whether amdegroot used draw_net.py to plot his SSD.jpg or some other tool?

agnonchik commented 6 years ago

I tried Caffe's draw_net.py on SSD-300 but the result had different look.

unicoe commented 5 years ago

@agnonchik hi, you now can draw the ssd graph?

maybe need ourself code answer: https://github.com/amdegroot/ssd.pytorch/issues/52

I solved this problem,use https://github.com/szagoruyko/pytorchviz/blob/master/torchviz/dot.py

from torch.autograd import Variable
from utils.visualize import  make_dot
from ssd import build_ssd
import torch

ssd_net = build_ssd('train', 512, 2)
net = ssd_net

x = Variable(torch.randn(1,3,512,512))

y = net(x)

dot = make_dot(y, params=dict(net.named_parameters()))
print(dot)
dot.view()