zhanghang1989 / zhanghang1989/PyTorch-Encoding

These functions are not supported by TorchScript. Any solutions?

Open
#354 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2k
Forks
448
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm working on converting the trained model to format .pt which can be used in c++, and there are some functions not supported by TorchScript(torch.jit).
In functions/encoding.py line 61 & 95:
.apply() not supported.
In line 24:
these methods implemented by pybind11 are not supported.

Are there any convenient solutions, such as implement it with methods packaged by PyTorch? Hoping some suggestions, and I will do it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting functions/encoding.py at lines 24, 61, and 95 and reproducing the .pt conversion with TorchScript. Done means the affected functions no longer trigger the reported unsupported-method errors and the converted model can be used from C++.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.