Skip to content

Question: Pytorch load a2 model and export onnx model #703

Description

@AndrewCapon

Hi Guys,

Sorry this is a question rather than an issue.

I'm banging my head against the wall about how to do this, has anyone got any links or info of how to go about this?

Thanks

Andy

Activity

  1. changed the title [-]Question: Pytorch load a2 model and export onyx model?[/-] [+]Question: Pytorch load a2 model and export onnx model[/+] on Sep 21, 2026
  2. sdatkinson commented on Sep 22, 2026

    @sdatkinson
    Owner

    There is an example for ONNX with NAM's LSTM model in an older version.

    I didn't implement it for the WaveNet / A2 because ONNX does not easily understand how to give the right code (for real-time use, anyway). This is why custom C++ like NeuralAmpModelerCore is so useful.

    Feel free to close if this answers your question / lmk if not.

  3. AndrewCapon commented on Sep 23, 2026

    @AndrewCapon
    Author

    Many thanks for the reply.

    It is WaveNet I am having some the issues with using torch.onnx.export so maybe I am trying the impossible, I don't know much at all about PyTorch!

    Sorry for another dumb question but the other way may be to export to quantised TFLight, do you think I will have issues with WaveNet there as well?

  4. sdatkinson commented on Oct 7, 2026

    @sdatkinson
    Owner

    The fundamental problem is that machine learning frameworks typically assume that the neural network is stateless; real-time use of a model in audio requires persisting state over calls to process buffers. Without that, you have to re-compute the whole receptive field's worth of history, which can 1000x how much compute it takes in somewhat normal circumstances.

    Understanding how the convolution class works in NeuralAmpModelerCore (and how that's different from how this repo does it) will help you understand the issue at the bottom of it. Over here, we process long chunks of thousands of samples at a time so that the "warm up" is more negligible; in real-time, the processing is often over tiny amounts of samples--tens or less, so that overhead would dominate.

  5. AndrewCapon commented on Oct 7, 2026

    @AndrewCapon
    Author

    Thanks, I will look into what the NeuralAmpModelerCore is doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions