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

how to save a fine tuned model and load it back?[Question] #1352

Closed niloofarmaani1 closed 3 years ago

niloofarmaani1 commented 3 years ago

hi I am trying to save the model after fine tuning by using: torch.save(quartznet,'fine_tuned2.pt') but I get this error: AttributeError: Can't pickle local object 'FilterbankFeatures.init..' how can I save the model and load it back again? thanks Niloo

okuchaiev commented 3 years ago

You can use .save_to/.restore_from methods to save to and restore from ".nemo" file. ".nemo" file is a simply ".tar.gz" file (you can rename it to tar.gz and unpack) with checkpoint weights, configuration yaml which was used and (for some models) additional artifacts such as tokenizer's vocabulary, etc.