Convert .Nemo to CoreML #3049
Unanswered
monologue110
asked this question in
Q&A
Replies: 1 comment
-
We don't support export of the preprocessor. You can use model.export("filename.ts") to export to torchscript but we don't expect it to work on CoreML since we don't test it for such use c |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've tried to convert both the quartnet.nemo model and citrinet.nemo model output to the coreML format.
However, in the process of
torch.jit.trace()
, it always shows the argument error. Originally I didtorch.jit.trace(model_ev, example_input)
Then I tried to change the args to
torch.jit.trace(model_ev, kwarg)
where kwarg is{'processed_signal': single_example[0], 'processed_signal_len': single_example[1]}
now it showsAttributeError: 'EncDecCTCModelBPE' object has no attribute 'processed_signal'
Any idea how to really convert the model to coreML?
I've also tried to convert ONNX to CoreML and have not been able to complete it.
I've tried to fix it, but during .convert() ,
I got an error message RuntimeError: PyTorch convert function for op 'stft' not implemented.
Even when I change the torch.jit.trace() to torch.jit.script(), I got the same error message :
RuntimeError:
Unknown type name 'STFT':
File "/home/jovyan/.local/lib/python3.7/site-packages/nemo/collections/asr/parts/preprocessing/features.py", line 375
def get_seq_len(self, seq_len):
if isinstance(self.stft, STFT): ~~~~ <--- HERE
pad_amount = self.stft.pad_amount * 2
else:
'FilterbankFeatures.get_seq_len' is being compiled since it was called from 'FilterbankFeatures.forward'
File "/opt/conda/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 388
def forward(self, x, seq_len):
seq_len = self.get_seq_len(seq_len.float())
Beta Was this translation helpful? Give feedback.
All reactions