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

[TVMC][FIX] Compiler supports input with a slash #8481

Merged
merged 1 commit into from
Jul 16, 2021
Merged

Conversation

leeexyz
Copy link
Contributor

@leeexyz leeexyz commented Jul 15, 2021

Hi, community,

When I use TVMC to compile a model trained on GPU, the name of input have a slash, such as "gpu_0/data_0": Var(gpu_0/data_0, ty=TensorType([1, 3, 224, 224], float32)), TVMC complains that cannot find such inputs in the graph, shows as below.

Traceback (most recent call last):
  File "/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "~/tvm/python/tvm/driver/tvmc/__main__.py", line 24, in <module>
    tvmc.main.main()
  File "~/tvm/python/tvm/driver/tvmc/main.py", line 94, in main
    sys.exit(_main(sys.argv[1:]))
  File "~/tvm/python/tvm/driver/tvmc/main.py", line 87, in _main
    return args.func(args)
  File "~/tvm/python/tvm/driver/tvmc/compiler.py", line 140, in drive_compile
    tvmc_model = frontends.load_model(args.FILE, args.model_format, args.input_shapes)
  File "~/tvm/python/tvm/driver/tvmc/frontends.py", line 376, in load_model
    mod, params = frontend.load(path, shape_dict, **kwargs)
  File "~/tvm/python/tvm/driver/tvmc/frontends.py", line 171, in load
    return relay.frontend.from_onnx(model, shape=shape_dict, **kwargs)
  File "~/tvm/python/tvm/relay/frontend/onnx.py", line 3605, in from_onnx
    mod, params = g.from_onnx(graph, opset)
  File "~/tvm/python/tvm/relay/frontend/onnx.py", line 3355, in from_onnx
    self._shape
AssertionError: User specified the shape for inputs that weren't found in the graph: {'data_0': [1, 3, 224, 224]}

This PR updates the RE to match such input name. :)

@leandron leandron self-assigned this Jul 15, 2021
Copy link
Contributor

@leandron leandron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix @leeexyz. I'm happy to merge it after CI.

@junrushao junrushao merged commit c263f22 into apache:main Jul 16, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
zxy844288792 pushed a commit to zxy844288792/tvm that referenced this pull request Mar 4, 2022
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

Successfully merging this pull request may close these issues.

3 participants