torchview icon indicating copy to clipboard operation
torchview copied to clipboard

Graph is not getting displayed properly

Open anujonthemove opened this issue 1 year ago • 1 comments

Bug I am trying to visualize ResNet18 model but the graph that is being displayed is cut in half.

Steps To Reproduce

import torch

model = torch.hub.load('pytorch/vision:v0.10.0', 'resnet18', pretrained=True)
model.eval();

from torchview import draw_graph
batch_size = 2
model_graph = draw_graph(model, input_size=(batch_size, 3, 32, 32),  roll=True, device='meta')
model_graph.visual_graph

Screenshots / Text

output

anujonthemove avatar Aug 25 '23 14:08 anujonthemove

if you add this at the start of your notebook then it will fix this issue

import graphviz
graphviz.set_jupyter_format('png')

ksachdeva avatar Aug 30 '23 15:08 ksachdeva