question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with traced models

See original GitHub issue

If user passes a traced model into create_supervised* methods and specifies a device, there will be the following error:

traced_model = torch.jit.trace(model, z)

evaluator = create_supervised_evaluator(traced_model, metrics, device='cuda')
> RuntimeError: to is not supported on TracedModules

We need to check if model have the method .to

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vfdev-5commented, Dec 23, 2018

@TheCodez you can do it like this:

# Check if torch-nightly
if "dev" in torch.__version__:
     ...
else:
    ...
1reaction
vfdev-5commented, Dec 18, 2018

Probably, we should wait until this issue is done.

EDIT: https://github.com/pytorch/pytorch/pull/15340

Read more comments on GitHub >

github_iconTop Results From Across the Web

Traced Model is giving error on CUDA · Issue #4580 - GitHub
If you do not know the root cause of the problem, please post according to this template: ... Traced Model is giving error...
Read more >
Issues in trace-driven simulation | SpringerLink
This paper discusses the many issues associated with the input traces used in trace-driven simulation. A description of the different types of ...
Read more >
Running traced machine learning model fails - Bug reports
Hello! I have a traced model (followed the instructions from Imfusion-Inference to trace a pretrained torch model and to write a yaml file)....
Read more >
Model Tracing - coremltools
Tracing the model captures only the operations that are performed for a specific input. If your model uses a data-dependent control flow, such...
Read more >
torch.onnx — PyTorch 1.13 documentation
PyTorch models can be written using NumPy or Python types and functions, but during tracing, any variables of NumPy or Python types (rather...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found