nemo2riva not working as expected 
State: closed | Pull request: no
Labels: name: bug

name: stale

**Describe the bug**

Not able to convert the nemo model : stt_en_conformer_ctc_large.nemo to riva using nemo2riva

Model EncDecCTCModelBPE was successfully restored from /data/atc_tenant/asr/lsfadmin/temp/stt_en_conformer_ctc_large.nemo.
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/asr-scr-exported-encdecclsmodel.yaml for nemo.collections.asr.models.classification_models.EncDecClassificationModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/asr-stt-exported-encdecctcmodel.yaml for nemo.collections.asr.models.EncDecCTCModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/asr-stt-exported-encdectcmodelbpe.yaml for nemo.collections.asr.models.EncDecCTCModelBPE
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/nlp-isc-exported-bert.yaml for nemo.collections.nlp.models.IntentSlotClassificationModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/nlp-mt-exported-encdecmtmodel.yaml for nemo.collections.nlp.models.MTEncDecModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/nlp-pc-exported-bert.yaml for nemo.collections.nlp.models.PunctuationCapitalizationModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/nlp-qa-exported-bert.yaml for nemo.collections.nlp.models.QAModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/nlp-tc-exported-bert.yaml for nemo.collections.nlp.models.TextClassificationModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/nlp-tkc-exported-bert.yaml for nemo.collections.nlp.models.TokenClassificationModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/tts-exported-fastpitchmodel.yaml for nemo.collections.tts.models.FastPitchModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/tts-exported-hifiganmodel.yaml for nemo.collections.tts.models.HifiGanModel
[NeMo I 2023-03-13 13:21:57 schema:154] Loaded schema file /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/tts-exported-radttsmodel.yaml for nemo.collections.tts.models.RadTTSModel
[NeMo I 2023-03-13 13:21:57 schema:193] Found validation schema for nemo.collections.asr.models.EncDecCTCModelBPE at /usr/local/lib/python3.8/dist-packages/nemo2riva/validation_schemas/asr-stt-exported-encdectcmodelbpe.yaml
[NeMo I 2023-03-13 13:21:57 schema:222] Checking installed NeMo version ... 1.17.0rc0 OK (>=1.1)
[NeMo I 2023-03-13 13:21:57 artifacts:65] Found model at ./model_weights.ckpt
[NeMo E 2023-03-13 13:21:57 artifacts:112] nemo2riva's get_artifacts() was called but was unable to continue due to missing modules. Please ensure that nemo_toolkit and it's dependencies are all installed before re-running nemo2riva.
Traceback (most recent call last):
  File "/usr/local/bin/nemo2riva", line 8, in <module>
    sys.exit(nemo2riva())
  File "/usr/local/lib/python3.8/dist-packages/nemo2riva/cli/nemo2riva.py", line 55, in nemo2riva
    Nemo2Riva(args)
  File "/usr/local/lib/python3.8/dist-packages/nemo2riva/convert.py", line 85, in Nemo2Riva
    artifacts, manifest = get_artifacts(restore_path=nemo_in, model=model, passphrase=key, **patch_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/nemo2riva/artifacts.py", line 117, in get_artifacts
    if isinstance(_HAVE_PATCHES_ERROR_MSG, exception):
TypeError: isinstance() arg 2 must be a type or tuple of types

**Steps/Code to reproduce bug**

 nemo2riva --out stt_en_conformer_ctc_large.riva stt_en_conformer_ctc_large.nemo
The nemo model is the model that is available on ngc. 


**Expected behavior**

converted .riva model

**Environment overview (please complete the following information)**

 - Environment location: Docker deployed on a GPU machine
 - Method of NeMo install: git clone https://github.com/NVIDIA/NeMo && cd NeMo && ./reinstall.sh
 - If method of install is [Docker] Please refer to the docker file below
  FROM nvcr.io/nvidia/riva/riva-speech:2.7.0-servicemaker
  RUN apt-get update && apt install -y --reinstall python3-pip
  
  RUN  mkdir \
          /.local /.cache /data /nltk_data  /.jupyter \
          && chmod -R 777  \
	  /data /.local /.jupyter /.cache /nltk_data
  WORKDIR /
  RUN git clone https://github.com/NVIDIA/NeMo && cd NeMo && ./reinstall.sh
  RUN pip install torchvision jupyter

**Environment details**

If NVIDIA docker image is used you don't need to specify these.
Otherwise, please provide:
- OS version  Ubuntu 20.04.4
- PyTorch version torch==1.13.1
- Python version 3.8.10

**Additional context**

Add any other context about the problem here.
Example: GPU model