Coder Social home page Coder Social logo

Comments (3)

ZTMIDGO avatar ZTMIDGO commented on August 20, 2024 3
    device = 'cpu'
    c = torch.randn(1, 3, 256, 256, requires_grad=True).to(device)
    s = torch.randn(1, 3, 256, 256, requires_grad=True).to(device)

    mask_c = torch.randn(1, 2, 256, 256, requires_grad=True).to(device)
    mask_s = torch.randn(1, 2, 256, 256, requires_grad=True).to(device)

    diff_c = torch.randn(1, 136, 256, 256, requires_grad=True).to(device)
    diff_s = torch.randn(1, 136, 256, 256, requires_grad=True).to(device)

    lms_c = torch.randn(1, 68, 2, requires_grad=True).to(device)
    lms_s = torch.randn(1, 68, 2, requires_grad=True).to(device)

    input = ['c', 's', 'mask_c', 'mask_s', 'diff_c', 'diff_s', 'lms_c', 'lms_s']
    output = ['output']

    torch.onnx.export(self.solver.G, (c, s, mask_c, mask_s, diff_c, diff_s, lms_c, lms_s), 'model.onnx', verbose=True, 
    opset_version=15, input_names=input, output_names=output)

无法使用以上代码转换为onnx:
Exporting the operator inverse to ONNX opset version 15 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub.

希望可以指教一下如何解决问题。

from elegant.

Fcucgvhhhvjv avatar Fcucgvhhhvjv commented on August 20, 2024

@ZTMIDGO

    device = 'cpu'
    c = torch.randn(1, 3, 256, 256, requires_grad=True).to(device)
    s = torch.randn(1, 3, 256, 256, requires_grad=True).to(device)

    mask_c = torch.randn(1, 2, 256, 256, requires_grad=True).to(device)
    mask_s = torch.randn(1, 2, 256, 256, requires_grad=True).to(device)

    diff_c = torch.randn(1, 136, 256, 256, requires_grad=True).to(device)
    diff_s = torch.randn(1, 136, 256, 256, requires_grad=True).to(device)

    lms_c = torch.randn(1, 68, 2, requires_grad=True).to(device)
    lms_s = torch.randn(1, 68, 2, requires_grad=True).to(device)

    input = ['c', 's', 'mask_c', 'mask_s', 'diff_c', 'diff_s', 'lms_c', 'lms_s']
    output = ['output']

    torch.onnx.export(self.solver.G, (c, s, mask_c, mask_s, diff_c, diff_s, lms_c, lms_s), 'model.onnx', verbose=True, 
    opset_version=15, input_names=input, output_names=output)

Cannot convert to onnx using the above code: Exporting the operator inverse to ONNX opset version 15 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub.

Hope you can teach me how to solve the problem.

I don't know about the code but this error "Exporting the operator inverse to ONNX opset version 15 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub " i think can be fixed simply by using pytorch nightly

from elegant.

ZTMIDGO avatar ZTMIDGO commented on August 20, 2024

@Fcucgvhhhvjv Based on the support list listed by pytorch https://pytorch.org/docs/stable/onnx_supported_aten_ops.html, perhaps only replacing the operator will solve the problem

from elegant.

Related Issues (17)

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.