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

How to save tw.draw_model to image file #53

Open
jackieyung opened this issue Dec 12, 2019 · 2 comments
Open

How to save tw.draw_model to image file #53

jackieyung opened this issue Dec 12, 2019 · 2 comments

Comments

@jackieyung
Copy link

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.

@Yuuchuin
Copy link

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)

@yaochx
Copy link

yaochx commented Feb 27, 2020

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

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