RuntimeError when runnning inference
See original GitHub issueHi,
I’ve installed everything which is mentioned in the README and have downloaded an4
dataset using the script. Also, I’ve downloaded the pre-trained models from the GitHub releases, and checked out commit 655cd58 (otherwise the model is incompatible).
Now, when I run:
python test.py --model-path models/an4_pretrained.pth --test-manifest data/an4_val_manifest.csv --cuda
I’m getting the following error:
Traceback (most recent call last):
File "/root/anaconda3/envs/deepspeech_2/lib/python3.6/site-packages/torch/jit/annotations.py", line 95, in parse_type_line
arg_ann = eval(arg_ann_str, _eval_env)
File "<string>", line 1, in <module>
NameError: name 'Optional' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 7, in <module>
from data.data_loader import SpectrogramDataset, AudioDataLoader
File "/root/deepspeech.pytorch/data/__init__.py", line 1, in <module>
from . import data_loader
File "/root/deepspeech.pytorch/data/data_loader.py", line 13, in <module>
import torchaudio
File "/root/anaconda3/envs/deepspeech_2/lib/python3.6/site-packages/torchaudio-0.2-py3.6-linux-x86_64.egg/torchaudio/__init__.py", line 7, in <module>
from torchaudio import transforms, datasets, kaldi_io, sox_effects, legacy
File "/root/anaconda3/envs/deepspeech_2/lib/python3.6/site-packages/torchaudio-0.2-py3.6-linux-x86_64.egg/torchaudio/transforms.py", line 6, in <module>
from . import functional as F
File "/root/anaconda3/envs/deepspeech_2/lib/python3.6/site-packages/torchaudio-0.2-py3.6-linux-x86_64.egg/torchaudio/functional.py", line 108, in <module>
@torch.jit.script
File "/root/anaconda3/envs/deepspeech_2/lib/python3.6/site-packages/torch/jit/__init__.py", line 824, in script
fn = torch._C._jit_script_compile(ast, _rcb, get_default_args(obj))
File "/root/anaconda3/envs/deepspeech_2/lib/python3.6/site-packages/torch/jit/annotations.py", line 55, in get_signature
return parse_type_line(type_line)
File "/root/anaconda3/envs/deepspeech_2/lib/python3.6/site-packages/torch/jit/annotations.py", line 97, in parse_type_line
raise RuntimeError("Failed to parse the argument list of a type annotation: {}".format(str(e)))
RuntimeError: Failed to parse the argument list of a type annotation: name 'Optional' is not defined
I’m not quite sure how to debug this. I shall be grateful for any help, thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Model trains but I'm getting a RuntimeError during Inference
I am using Learner on a custom model. The model training works with learner.fit_one_cycle() but when I try to predict an output from...
Read more >Trying to run inference with custom model but get Runtime ...
I am loading the model in with: gtf = torch.load(model_dir, map_location=torch.device(“cpu”)) But I get a Runtime Error saying: Runti…
Read more >CUDA error while running bloom-accelerate-inference.py ...
Hello All,. Has anyone faced this issue, while running the bloom accelerate inference script? Is there a prescribed CUDA driver/python/torch ...
Read more >Troubleshooting machine learning inference
You might see the following errors when you run machine learning inference on a Raspberry Pi running Raspberry Pi OS Bullseye. RuntimeError: module...
Read more >OpenVINO YOLOv4 inference device didn't appear after ...
This issue (running YOLOv4 model with Object Detection Python Demo on MYRIAD device) is a known bug in OpenVINO 2021.4.752.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for fixing this @SeanNaren! \o/
Just a minor issue - the URL for the new release is broken (no dot after
v
).Here’s the correct one - https://github.com/SeanNaren/deepspeech.pytorch/releases/tag/v2.0
V2 has been released https://github.com/SeanNaren/deepspeech.pytorch/releases/tag/v.2.0