[Question]
State: closed | Pull request: no

**Describe your question**

I am trying to run NeMo ASR inside Ubuntu 20.04 docker container on Raspberry pi 4. I have compiled NeMo from source. 

When I try to run EncDecCTCModel.transcribe, I am getting the following error:

> Traceback (most recent call last):
>   File "main.py", line 43, in <module>
>     quartznet_inferencer.debugging("./debugging/infer_2.wav")
>   File "/workspace/codes/uluc/intellioven-ml/wake-up-word/quartznet_inferencer.py", line 54, in debugging
>     prediction = self.first_asr_model.transcribe([file_path])
>   File "/usr/local/lib/python3.8/dist-packages/torch/autograd/grad_mode.py", line 26, in decorate_context
>     return func(*args, **kwargs)
>   File "/workspace/install_stuff/NeMo/nemo/collections/asr/models/ctc_models.py", line 238, in transcribe
>     logits, logits_len, greedy_predictions = self.forward(
>   File "/workspace/install_stuff/NeMo/nemo/core/classes/common.py", line 772, in __call__
>     instance._validate_input_types(input_types=input_types, ignore_collections=self.ignore_collections, **kwargs)
>   File "/workspace/install_stuff/NeMo/nemo/core/classes/common.py", line 210, in _validate_input_types
>     raise TypeError("\n".join(error_msg))
> TypeError: NeuralTypeComparisonResult.INCOMPATIBLE :
> Input type expected : axes: (batch, time); elements_type: AudioSignal
>   input param_0 : freq: 16000
> Input type found : axes: (batch, time); elements_type: VoidType

My pip freeze is as follows:

> absl-py==0.12.0
> aiohttp==3.7.4.post0
> alabaster==0.7.12
> antlr4-python3-runtime==4.8
> appdirs==1.4.4
> async-timeout==3.0.1
> atomicwrites==1.1.5
> attrdict==2.0.1
> attrs==20.3.0
> audioread==2.1.9
> Babel==2.9.0
> black==19.10b0
> boto3==1.17.45
> botocore==1.20.45
> braceexpand==0.1.6
> cachetools==4.2.1
> certifi==2019.11.28
> cffi==1.14.5
> chardet==3.0.4
> click==7.1.2
> colorama==0.4.4
> configparser==5.0.2
> cycler==0.10.0
> Cython==0.29.22
> dbus-python==1.2.16
> decorator==5.0.5
> Distance==0.1.3
> distro-info===0.23ubuntu1
> docker-pycreds==0.4.0
> docopt==0.6.2
> docutils==0.17
> editdistance==0.5.3
> filelock==3.0.12
> frozendict==1.2
> fsspec==0.9.0
> future==0.18.2
> g2p-en==2.1.0
> gdown==3.12.2
> gitdb==4.0.7
> GitPython==3.1.14
> google-auth==1.28.0
> google-auth-oauthlib==0.4.4
> grpcio==1.36.1
> h5py==3.2.1
> hydra-core==1.0.6
> idna==2.8
> imagesize==1.2.0
> importlib-metadata==1.5.0
> importlib-resources==5.1.2
> inflect==5.3.0
> iniconfig==1.1.1
> ipadic==1.0.0
> isort==4.3.21
> jieba==0.42.1
> Jinja2==2.11.3
> jmespath==0.10.0
> joblib==1.0.1
> kaldi-io==0.9.4
> kaldi-python-io==1.2.2
> kaldiio==2.17.2
> kiwisolver==1.3.1
> latexcodec==2.0.1
> librosa==0.8.0
> llvmlite==0.36.0
> Markdown==3.3.4
> MarkupSafe==1.1.1
> marshmallow==3.11.1
> matplotlib==3.4.1
> mecab-python3==1.0.3
> megatron-lm==2.2.0
> more-itertools==4.2.0
> mpmath==1.2.1
> multidict==5.1.0
> -e git+https://github.com/NVIDIA/NeMo@347cbeaa3695312385ec3c408910ccb6aa4f29e4#egg=nemo_toolkit
> nltk==3.5
> nose==1.3.7
> numba==0.53.1
> numpy==1.20.2
> oauthlib==3.1.0
> olefile==0.46
> omegaconf==2.0.6
> onnx==1.8.1
> OpenCC==0.2
> packaging==20.9
> pandas==1.2.3
> pangu==4.0.6.1
> parameterized==0.8.1
> pathspec==0.8.1
> pathtools==0.1.2
> pesq==0.0.2
> Pillow==8.2.0
> pip-api==0.0.20
> pipreqs==0.4.10
> playsound==1.2.2
> pluggy==0.13.1
> pooch==1.3.0
> portalocker==2.0.0
> promise==2.3
> protobuf==4.0.0rc2
> psutil==5.8.0
> py==1.10.0
> pyannote.core==4.1
> pyannote.database==4.0.4
> pyannote.metrics==3.0.1
> pyasn1==0.4.8
> pyasn1-modules==0.2.8
> PyAudio==0.2.11
> pybind11==2.6.2
> pybtex==0.24.0
> pybtex-docutils==1.0.0
> pycparser==2.20
> pydub==0.25.1
> Pygments==2.3.1
> PyGObject==3.36.0
> pyparsing==2.4.7
> pypinyin==0.41.0
> PySocks==1.7.1
> pystoi==0.3.3
> pytest==6.2.3
> pytest-runner==5.3.0
> python-apt==2.0.0+ubuntu0.20.4.4
> python-dateutil==2.8.1
> pytorch-lightning==1.2.6
> pytz==2021.1
> PyYAML==5.3.1
> rapidfuzz==1.4.1
> regex==2021.4.4
> requests==2.22.0
> requests-oauthlib==1.3.0
> requests-unixsocket==0.2.0
> resampy==0.2.2
> rsa==4.7.2
> ruamel.yaml==0.17.2
> ruamel.yaml.clib==0.2.2
> s3transfer==0.3.6
> sacrebleu==1.5.1
> sacremoses==0.0.44
> scikit-learn==0.22.2.post1
> scipy==1.6.2
> semantic-version==2.8.5
> sentencepiece==0.1.95
> sentry-sdk==1.0.0
> setuptools-rust==0.12.1
> shellingham==1.4.0
> shortuuid==1.0.1
> simplejson==3.17.2
> six==1.14.0
> smmap==4.0.0
> snowballstemmer==2.1.0
> sortedcontainers==2.3.0
> SoundFile==0.10.3.post1
> sox==1.4.1
> spectralcluster==0.1.0
> Sphinx==3.5.3
> sphinxcontrib-applehelp==1.0.2
> sphinxcontrib-bibtex==2.2.0
> sphinxcontrib-devhelp==1.0.2
> sphinxcontrib-htmlhelp==1.0.3
> sphinxcontrib-jsmath==1.0.1
> sphinxcontrib-qthelp==1.0.3
> sphinxcontrib-serializinghtml==1.1.4
> subprocess32==3.5.4
> sympy==1.7.1
> tabulate==0.8.9
> tensorboard==2.4.1
> tensorboard-plugin-wit==1.8.0
> threadpoolctl==2.1.0
> tokenizers==0.10.2
> toml==0.10.2
> torch @ https://github.com/KumaTea/pytorch-aarch64/releases/download/v1.7.1/torch-1.7.1-cp38-cp38-linux_aarch64.whl
> torch-stft==0.1.4
> torchaudio @ https://github.com/KumaTea/pytorch-aarch64/releases/download/v1.7.1/torchaudio-0.7.2-cp38-cp38-linux_aarch64.whl
> torchmetrics==0.2.0
> torchvision @ https://github.com/KumaTea/pytorch-aarch64/releases/download/v1.7.1/torchvision-0.8.2-cp38-cp38-linux_aarch64.whl
> tqdm==4.60.0
> transformers==4.4.2
> typed-ast==1.4.2
> typer==0.3.2
> typing-extensions==3.7.4.3
> unattended-upgrades==0.1
> Unidecode==1.2.0
> urllib3==1.25.8
> wandb==0.10.25
> wcwidth==0.1.8
> webdataset==0.1.54
> Werkzeug==1.0.1
> wget==3.2
> wrapt==1.12.1
> yarg==0.1.9
> yarl==1.6.3
> youtokentome==1.0.6
> zipp==1.0.0

Anyone knows how can I fix this? Thanks.

**Environment overview (please complete the following information)**

 - Environment location: [Bare-metal, Docker, Cloud(specify cloud provider - AWS, Azure, GCP, Collab)]
 - Method of NeMo install: [pip install or from source]. Please specify exact commands you used to install.
 - If method of install is [Docker], provide `docker pull` & `docker run` commands used

**Environment details**

If NVIDIA docker image is used you don't need to specify these.
Otherwise, please provide:
- OS version: Docker with Ubuntu 20.04
- PyTorch version: 1.7.1
- Python version: 3.8.5

**Additional context**

Add any other context about the problem here.
On aarch64 cpu


Seems you're encountering a neural type error. Are you certain the audio is a 16 KHz monochannel wav file ? As a temporary measure to check if the file is not the issue you can disable type checking globally by following https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/r1.0.0rc1/core/core.html#neural-types

`with typecheck.disable_checks():`

> Seems you're encountering a neural type error. Are you certain the audio is a 16 KHz monochannel wav file ? As a temporary measure to check if the file is not the issue you can disable type checking globally by following https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/r1.0.0rc1/core/core.html#neural-types
> 
> `with typecheck.disable_checks():`

Thanks. I am sure that my audio is monochannel 16KHz. I disabled the type check. 

Issue is gone but I am getting wrong predictions for some reason on arm devices. I guess this is a different issue.

Hi @ulucsahin, I am having a similar issue while trying to use NeMo with a Jetson AGX Xavier (arm 64 bit arch). Did you manage to solve it?

> Hi @ulucsahin, I am having a similar issue while trying to use NeMo with a Jetson AGX Xavier (arm 64 bit arch). Did you manage to solve it?

If you have Type error, I solved it by changing versions. A fresh installation should not have the issue as far as I know.

If you have the wrong predictions issue, it was caused by getting wrong values from PyTorch's log_softmax function when using Arm cpu. I replaced the log_softmax with another implementation of log_softmax and the issue is gone.

Yes I only have Type error. So which versions should I change? At the moment I compiled nemo from source, using main branch 

I am using NeMo 1.0.0b3 and PyTorch 1.7.1 without problems. I also tested with PyTorch 1.9. I am not sure why the error happens and not even sure if the versions are the cause of it actually. Like titu1994 said, you can try wrapping code with "with typecheck.disable_checks()". 

Ok, I'll try with these versions. Thank you for your time!

@ulucsahin Hi! Did you manage to fix errors on PyTorch 1.9?

No, I continued using 1.7.1. You can try using `with typecheck.disable_checks()`.