ba4be087d5
CICD NeMo / cicd-main-unit-tests (push) Blocked by required conditions
CICD NeMo / cicd-main-speech (push) Blocked by required conditions
CICD NeMo / cicd-test-container-build (push) Blocked by required conditions
CICD NeMo / cicd-import-tests (push) Blocked by required conditions
CICD NeMo / L0_Setup_Test_Data_And_Models (push) Blocked by required conditions
CICD NeMo / Nemo_CICD_Test (push) Blocked by required conditions
CICD NeMo / Coverage (e2e) (push) Blocked by required conditions
CICD NeMo / Coverage (unit-test) (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Create PR to main with cherry-pick from release / cherry-pick (push) Failing after 0s
CICD NeMo / pre-flight (push) Failing after 0s
CICD NeMo / configure (push) Has been skipped
Build, validate, and release Neural Modules / pre-flight (push) Failing after 1s
CICD NeMo / code-linting (push) Has been skipped
CICD NeMo / cicd-wait-in-queue (push) Waiting to run
Build, validate, and release Neural Modules / release (push) Has been skipped
Build, validate, and release Neural Modules / release-summary (push) Has been cancelled
60 lines
2.2 KiB
ReStructuredText
60 lines
2.2 KiB
ReStructuredText
Checkpoints
|
|
===========
|
|
|
|
There are two main ways to load pretrained checkpoints in NeMo:
|
|
|
|
* Using the :code:`restore_from()` method to load a local checkpoint file (``.nemo``), or
|
|
* Using the :code:`from_pretrained()` method to download and set up a checkpoint from the cloud.
|
|
|
|
Note that these instructions are for loading fully trained checkpoints for evaluation or fine-tuning. For resuming an unfinished
|
|
training experiment, use the Experiment Manager to do so by setting the ``resume_if_exists`` flag to ``True``.
|
|
|
|
Local Checkpoints
|
|
-------------------------
|
|
|
|
* **Save Model Checkpoints**: NeMo automatically saves final model checkpoints with ``.nemo`` suffix. You could also manually save any model checkpoint using :code:`model.save_to(<checkpoint_path>.nemo)`.
|
|
* **Load Model Checkpoints**: if you'd like to load a checkpoint saved at ``<path/to/checkpoint/file.nemo>``, use the :code:`restore_from()` method below, where ``<MODEL_BASE_CLASS>`` is the model class of the original checkpoint.
|
|
|
|
.. code-block:: python
|
|
|
|
import nemo.collections.audio as nemo_audio
|
|
model = nemo_audio.models.<MODEL_BASE_CLASS>.restore_from(restore_path="<path/to/checkpoint/file.nemo>")
|
|
|
|
Pretrained Checkpoints
|
|
----------------------
|
|
|
|
The table below in :ref:`checkpoints_audio_models` list part of available pre-trained audio processing models including speech processing, restoration and extraction.
|
|
|
|
Load Model Checkpoints
|
|
^^^^^^^^^^^^^^^^^^^^^^
|
|
The models can be accessed via the :code:`from_pretrained()` method inside the audio model class. In general, you can load any of these models with code in the following format,
|
|
|
|
.. code-block:: python
|
|
|
|
import nemo.collections.audio as nemo_audio
|
|
model = nemo_audio.models.<MODEL_BASE_CLASS>.from_pretrained(model_name="<MODEL_NAME>")
|
|
|
|
where ``<MODEL_NAME>`` is the value in ``Model Name`` column in the tables in :ref:`checkpoints_audio_models`. These names are predefined in the each model's member function ``self.list_available_models()``.
|
|
|
|
|
|
.. _checkpoints_audio_models:
|
|
|
|
Audio Models
|
|
------------
|
|
|
|
Speech Enhancement Models
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
.. csv-table::
|
|
:file: data/checkpoints_se.csv
|
|
:align: left
|
|
:header-rows: 1
|
|
|
|
SSL Models
|
|
^^^^^^^^^^
|
|
|
|
.. csv-table::
|
|
:file: data/checkpoints_ssl.csv
|
|
:align: left
|
|
:header-rows: 1
|