Inference script error while working with NeMo pretrained ASR models with the given docker container.
State: closed | Pull request: no
Labels: name: bug

I have trying to use the pretrained **Jaspernet model** to get the inference on my own data. I am using the following script:
`python examples/asr/speech_to_text_infer.py --asr_model="stt_en_jasper10x5dr" --dataset="pfe_16khz_rn/test.json" --use_cer
`

After running this script, I keep getting the following error. I am getting the same error on example **an4 dataset** as well. Can't see to find any solution online. I am using the NeMo docker file given in this repository for version 1.1.0. 

```
root@408411e5bd29:/workspace/asr/NeMo#` python examples/asr/speech_to_text_infer.py --asr_model="stt_en_jasper10x5dr" --dataset="pfe_16khz_rn/test.json" --use_cer
/opt/conda/lib/python3.8/site-packages/pytorch_lightning/metrics/__init__.py:43: LightningDeprecationWarning: `pytorch_lightning.metrics.*` module has been renamed to `torchmetrics.*` and split off to its own package (https://github.com/PyTorchLightning/metrics) since v1.3 and will be removed in v1.5
  rank_zero_deprecation(
################################################################################
### WARNING, path does not exist: KALDI_ROOT=/mnt/matylda5/iveselyk/Tools/kaldi-trunk
###          (please add 'export KALDI_ROOT=<your_path>' in your $HOME/.profile)
###          (or run as: KALDI_ROOT=<your_path> python <your_script>.py)
################################################################################

[NeMo W 2021-08-13 15:44:55 nemo_logging:349] /opt/conda/lib/python3.8/site-packages/torchaudio-0.7.0a0+42d447d-py3.8-linux-x86_64.egg/torchaudio/backend/utils.py:53: UserWarning: "sox" backend is being deprecated. The default backend will be changed to "sox_io" backend in 0.8.0 and "sox" backend will be removed in 0.9.0. Please migrate to "sox_io" backend. Please refer to https://github.com/pytorch/audio/issues/903 for the detail.
      warnings.warn(

[NeMo W 2021-08-13 15:44:56 experimental:27] Module <class 'nemo.collections.asr.data.audio_to_text_dali.AudioToCharDALIDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
[NeMo I 2021-08-13 15:44:56 speech_to_text_infer:67] Using NGC cloud ASR model stt_en_jasper10x5dr
[NeMo I 2021-08-13 15:44:56 cloud:56] Found existing object /root/.cache/torch/NeMo/NeMo_1.1.0/stt_en_jasper10x5dr/856ae08d5c4bd78b5e27f696e96f7aab/stt_en_jasper10x5dr.nemo.
[NeMo I 2021-08-13 15:44:56 cloud:62] Re-using file from: /root/.cache/torch/NeMo/NeMo_1.1.0/stt_en_jasper10x5dr/856ae08d5c4bd78b5e27f696e96f7aab/stt_en_jasper10x5dr.nemo
[NeMo I 2021-08-13 15:44:56 common:676] Instantiating model from pre-trained checkpoint
[NeMo W 2021-08-13 15:45:05 modelPT:138] If you intend to do training or fine-tuning, please call the ModelPT.setup_training_data() method and provide a valid configuration file to setup the train data loader.
    Train config :
    manifest_filepath: /data2/voices/train_1k.json
    sample_rate: 16000
    labels:
    - ' '
    - a
    - b
    - c
    - d
    - e
    - f
    - g
    - h
    - i
    - j
    - k
    - l
    - m
    - 'n'
    - o
    - p
    - q
    - r
    - s
    - t
    - u
    - v
    - w
    - x
    - 'y'
    - z
    - ''''
    batch_size: 32
    trim_silence: true
    max_duration: 16.7
    shuffle: true
    is_tarred: false
    tarred_audio_filepaths: null

[NeMo W 2021-08-13 15:45:05 modelPT:145] If you intend to do validation, please call the ModelPT.setup_validation_data() or ModelPT.setup_multiple_validation_data() method and provide a valid configuration file to setup the validation data loader(s).
    Validation config :
    manifest_filepath: /data2/voices/train_1k_samp.json
    sample_rate: 16000
    labels:
    - ' '
    - a
    - b
    - c
    - d
    - e
    - f
    - g
    - h
    - i
    - j
    - k
    - l
    - m
    - 'n'
    - o
    - p
    - q
    - r
    - s
    - t
    - u
    - v
    - w
    - x
    - 'y'
    - z
    - ''''
    batch_size: 32
    shuffle: false

[NeMo I 2021-08-13 15:45:05 features:252] PADDING: 16
[NeMo I 2021-08-13 15:45:05 features:269] STFT using torch
[NeMo I 2021-08-13 15:45:16 modelPT:439] Model EncDecCTCModel was successfully restored from /root/.cache/torch/NeMo/NeMo_1.1.0/stt_en_jasper10x5dr/856ae08d5c4bd78b5e27f696e96f7aab/stt_en_jasper10x5dr.nemo.
Traceback (most recent call last):
  File "examples/asr/speech_to_text_infer.py", line 114, in <module>
    main()  # noqa pylint: disable=no-value-for-parameter
  File "examples/asr/speech_to_text_infer.py", line 73, in main
    asr_model.setup_test_data(
  File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/models/ctc_models.py", line 482, in setup_test_data
    self._test_dl = self._setup_dataloader_from_config(config=test_data_config)
  File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/models/ctc_models.py", line 348, in _setup_dataloader_from_config
    audio_to_text_dataset.inject_dataloader_value_from_model_config(self.cfg, config, key='sample_rate')
  File "/opt/conda/lib/python3.8/site-packages/nemo/collections/asr/data/audio_to_text_dataset.py", line 55, in inject_dataloader_value_from_model_config
    with open_dict(dataloader_cfg):
  File "/opt/conda/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/opt/conda/lib/python3.8/site-packages/omegaconf/omegaconf.py", line 937, in open_dict
    prev_state = config._get_node_flag("struct")
AttributeError: 'dict' object has no attribute '_get_node_flag'

```

![error_nemo](https://user-images.githubusercontent.com/19801035/129387319-ab76d205-149d-42d2-bae1-3b568a89256e.PNG)

Any help is appreciated. Thanks in advance.