NVIDIA / NeMo

A scalable generative AI framework built for researchers and developers working on Large Language Models, Multimodal, and Speech AI (Automatic Speech Recognition and Text-to-Speech)
https://docs.nvidia.com/nemo-framework/user-guide/latest/overview.html
Apache License 2.0
11.84k stars 2.46k forks source link

ASR Tutorial | ASR_with_Nemo | from_pretrained not defined. #3369

Closed chaksam closed 2 years ago

chaksam commented 2 years ago

I am trying the tutorial ASR_with_NeMo.ipynb. It's giving me following error. I checked the code for EncDecCTCModel, it doesn't contain the function "from_pretrained". How to load the pre-trained models: I even tried to use restorefrom after downloading the respective *.nemo file. But getting same issue there as well ('EncDecCTCModel' has no attribute 'restorefrom')

# This line will download pre-trained QuartzNet15x5 model from NVIDIA's NGC cloud and instantiate it for you quartznet = nemo_asr.models.EncDecCTCModel.from_pretrained(model_name="QuartzNet15x5Base-En")

Error:

AttributeError Traceback (most recent call last) /tmp/ipykernel_349758/1493780281.py in 1 # This line will download pre-trained QuartzNet15x5 model from NVIDIA's NGC cloud and instantiate it for you ----> 2 quartznet = nemo_asr.models.EncDecCTCModel.from_pretrained(model_name="QuartzNet15x5Base-En")

AttributeError: type object 'EncDecCTCModel' has no attribute 'from_pretrained'

titu1994 commented 2 years ago

Did you follow all the cells for instalation ? Do other models fail to restore as well ? This usually happens if you use an incorrect model type to try to restore the model. Make sure EncDecCTCModel.list_available_models() has the model name you want to load.

titu1994 commented 2 years ago

It probably stems from incorrect Nemo installation as well, did you install the extra requirements such as Cython from https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/starthere/intro.html#installation

chaksam commented 2 years ago

It probably stems from incorrect Nemo installation as well, did you install the extra requirements such as Cython from https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/main/starthere/intro.html#installation

Yes, this resolved the issue. Some of the requirements were not getting satisfied. After installing those, it worked fine.