tensorwatch icon indicating copy to clipboard operation
tensorwatch copied to clipboard

How to save tw.draw_model to image file

Open jackieyung opened this issue 6 years ago • 2 comments

I can only run my model on server, so I can't see the model graph directly from the example code: tw.draw_model. So, anyone can tell me how to save the graph data to image file? Thanks.

jackieyung avatar Dec 12 '19 15:12 jackieyung

The result of tw.draw_model is a object of DotWrapper Calss. You can save tw.draw_model to image file as follow:

img = tw.draw_model(model, [1, 3, 224, 224]) # list cantains the size of input tensor img.save(filename)

Yuuchuin avatar Dec 16 '19 10:12 Yuuchuin

I find the method help info by help(tw.draw_model) draw_model(model, input_shape=None, orientation='TB', png_filename=None) after running this code tw.draw_model(model, [1, 3, 224, 224], 'model.png') nothing was saved

using img.save, the png resolution is too low to see the model graph

yaochx avatar Feb 27 '20 08:02 yaochx