Giter VIP home page Giter VIP logo

Comments (6)

miccio-dk avatar miccio-dk commented on June 14, 2024 2

Other update: this issue is currently tracked on pytorch repo: pytorch/pytorch#75383

from nisqa.

miccio-dk avatar miccio-dk commented on June 14, 2024

Update: when trying to export the model from Linux (or WSL in my case), I get the following, more verbose errors:

Device: cpu
Model architecture: NISQA_DIM
Loaded pretrained model from weights/nisqa.tar
/home/username/miniconda3/envs/nisqa/lib/python3.9/site-packages/torch/onnx/utils.py:1294: UserWarning: Provided key output for dynamic axes is not a valid input/output name
  warnings.warn("Provided key {} for dynamic axes is not a valid input/output name".format(key))
WARNING: The shape inference of prim::PackPadded type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PackPadded type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
/home/username/miniconda3/envs/nisqa/lib/python3.9/site-packages/torch/onnx/symbolic_helper.py:258: UserWarning: ONNX export failed on adaptive_max_pool2d because input size not accessible not supported
  warnings.warn("ONNX export failed on " + op + " because " + msg + " not supported")
/home/username/miniconda3/envs/nisqa/lib/python3.9/site-packages/torch/onnx/symbolic_helper.py:716: UserWarning: allowzero=0 by default. In order to honor zero value in shape use allowzero=1
  warnings.warn("allowzero=0 by default. In order to honor zero value in shape use allowzero=1")
WARNING: The shape inference of prim::PadPacked type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PadPacked type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
Segmentation fault

PS: you can access my script here: https://github.com/miccio-dk/NISQA
Notice that run_export.py behaves exactly like run_predict.py except I'm forcing CPU.

from nisqa.

gabrielmittag avatar gabrielmittag commented on June 14, 2024

Thanks, hopefully, someone will be able to help in the PyTorch repo. I haven't converted this particular model to ONNX before but a workaround you could try is to remove the packed sequence parts altogether if this is causing the errors. Actually, that's what I used to do with other models because ONNX didn't use to support packed sequences then.

from nisqa.

gabrielmittag avatar gabrielmittag commented on June 14, 2024

Closing this as it is not directly related to the model but rather to PyTorch. BTW - if you want to export it to ONNX you probably need to use the model without adaptive pooling layers and without packed sequences. Then it should work

from nisqa.

JBloodless avatar JBloodless commented on June 14, 2024

@gabrielmittag do I need to retrain the model after removing packed sequences or there are some kind of workaround here? Stuck on similar problem, only packed sequences are the issue for me

from nisqa.

wuzhuohong avatar wuzhuohong commented on June 14, 2024

Update: when trying to export the model from Linux (or WSL in my case), I get the following, more verbose errors:

Device: cpu
Model architecture: NISQA_DIM
Loaded pretrained model from weights/nisqa.tar
/home/username/miniconda3/envs/nisqa/lib/python3.9/site-packages/torch/onnx/utils.py:1294: UserWarning: Provided key output for dynamic axes is not a valid input/output name
  warnings.warn("Provided key {} for dynamic axes is not a valid input/output name".format(key))
WARNING: The shape inference of prim::PackPadded type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PackPadded type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
/home/username/miniconda3/envs/nisqa/lib/python3.9/site-packages/torch/onnx/symbolic_helper.py:258: UserWarning: ONNX export failed on adaptive_max_pool2d because input size not accessible not supported
  warnings.warn("ONNX export failed on " + op + " because " + msg + " not supported")
/home/username/miniconda3/envs/nisqa/lib/python3.9/site-packages/torch/onnx/symbolic_helper.py:716: UserWarning: allowzero=0 by default. In order to honor zero value in shape use allowzero=1
  warnings.warn("allowzero=0 by default. In order to honor zero value in shape use allowzero=1")
WARNING: The shape inference of prim::PadPacked type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
WARNING: The shape inference of prim::PadPacked type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.
Segmentation fault

PS: you can access my script here: https://github.com/miccio-dk/NISQA Notice that run_export.py behaves exactly like run_predict.py except I'm forcing CPU.

I wondor if you have solve this problem. Same Problem I met.

from nisqa.

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.