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

Add more easy-use function interface #2

Closed
Jittor opened this issue Jun 25, 2021 · 2 comments
Closed

Add more easy-use function interface #2

Jittor opened this issue Jun 25, 2021 · 2 comments

Comments

@Jittor
Copy link
Collaborator

Jittor commented Jun 25, 2021

Currently, visualize a computation graph needs to export pkl file and load in jittorvis, it is not straightforward, we can do it in a better way:

import jittorvis
import jittor as jt
from jittor.models import resnet18

model = resnet18()
img = jt.rand((1,3,100,100))

jittorvis.visualize_model(model, img, ip=xxxx, port=xxxx, ...)
@swordsbird
Copy link
Collaborator

in the updated version, we can use jittorvis in the following way:

import jittor as jt
from jittor.models import resnet18
from jittorvis import server

model = resnet18()
with jt.flag_scope(trace_py_var=2, trace_var_data=1):
  output = model(input)
  output.sync()
  trace_data = jt.dump_trace_data()
  jt.clear_trace_data()
server.run(trace_data, port=5005, host='0.0.0.0')

In this way you don't need to export pkl file and reload in jittorvis. Also, we will introduce the function "visualize_model" in jittorvis soon.

@swordsbird
Copy link
Collaborator

Solved

ThuWangzw added a commit that referenced this issue Oct 25, 2021
feat: add a simple network layout
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