pytorch / pytorch/audio

Exporting the operator stft to ONNX opset version 9 is not supported.

Open
#982 21 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.9k
Forks
798
Avg merge
58m
Merged PRs (30d)
3

Description

Hi, I try exporting the process of feature extraction to onnx:

import torch
import torchaudio

model = torchaudio.transforms.MelSpectrogram()
x = torch.randn(1, 16000)
torch.onnx.export(model, x, 'tmp.onnx', input_names=['input'], output_names=['output'])

and get:

RuntimeError: Exporting the operator stft to ONNX opset version 9 is not supported. Please open a bug to request ONNX export support for the missing operator.

So will torchaudio add supports operators used in torchaudio.transforms module in the future? You see that exporting the process of feature extraction and the neural network together will be very convenient.

Thanks!

Contributor guide

Open the contributing guide

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 with torchaudio.transforms.MelSpectrogram and the torch.onnx.export call shown in the issue. Check the ONNX opset 9 handling for the stft operator and related torchaudio.transforms operators; done means the feature-extraction process exports successfully without the reported unsupported-operator error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
audio-video-rtc, 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.