Giter Club home page Giter Club logo

Comments (4)

Atze00 avatar Atze00 commented on August 15, 2024

Unfortunately I have no plans to support TorchScript at the moment. I'm also not convinced that's the only problem, for example the computation of same padding could raise an error. If that's the case I suspect it would also be necessary to train the models from scratch in pytorch.

from movinet-pytorch.

SMHendryx avatar SMHendryx commented on August 15, 2024

The type hint issue was easy to get around but even more problematic is the use of einops which appears to be noncompat with torchscript

from torch import nn
import torch
from einops import rearrange
class Foo(nn.Module):
    def __init__(self):
        super(Foo, self).__init__()
    def forward(self, x):
        return rearrange(x, 'a b -> b a')
torch.jit.script(Foo())
...
NotSupportedError: Compiled functions can't take variable number of arguments or use keyword-only arguments with defaults:
  File "/Users/sean/standard/.env/lib/python3.6/site-packages/einops/einops.py", line 393
def rearrange(tensor, pattern: str, **axes_lengths):
                                     ~~~~~~~~~~~~~ <--- HERE

It looks like tracing may be compatible, though is more restrictive, per the issue on einops arogozhnikov/einops#115

foo = Foo()
traced_foo = torch.jit.trace(foo, torch.rand(3, 3))

from movinet-pytorch.

apurva1526 avatar apurva1526 commented on August 15, 2024

Is there any solution to this problem?

from movinet-pytorch.

Subalzero avatar Subalzero commented on August 15, 2024

I have a fork that modifies the models so that it can be exported to TorchScript or ONNX.
https://github.com/Subalzero/MoViNet-pytorch

from movinet-pytorch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.