Load pre-trained models
See original GitHub issueHey @mravanelli @pplantinga @Gastron @TParcollet ,
With my transducer, I’m thinking about adding specific pre-trained option to handle the load of pre-trained models from CTC for example…
The first solution is to add an option in checkpointer like this:
checkpointer: !new:speechbrain.utils.checkpoints.Checkpointer
checkpoints_dir: !ref <save_folder>
recoverables:
encoder_crdnn: !ref <encoder_crdnn>
encoder_lin: !ref <encoder_lin>
decoder_gru: !ref <decoder_gru>
decoder_lin: !ref <decoder_lin>
joint_lin: !ref <joint_lin>
output: !ref <output>
optimizer: !ref <optimizer>
scheduler: !ref <lr_annealing>
normalizer: !ref <normalize>
counter: !ref <epoch_counter>
And consider that encoder_crdnn and encoder_lin have same dim as CTC recipe…I’m thinking about creating an option like:
checkpointer: !new:speechbrain.utils.checkpoints.Checkpointer
checkpoints_dir: !ref <save_folder>
pre-trained-dir: !ref <pretrained_folder>
load-pre-trained:
encoder_crdnn: !ref <encoder_crdnn>
encoder_lin: !ref <encoder_lin>
recoverables:
encoder_crdnn: !ref <encoder_crdnn>
encoder_lin: !ref <encoder_lin>
decoder_gru: !ref <decoder_gru>
decoder_lin: !ref <decoder_lin>
joint_lin: !ref <joint_lin>
output: !ref <output>
optimizer: !ref <optimizer>
scheduler: !ref <lr_annealing>
normalizer: !ref <normalize>
counter: !ref <epoch_counter>
Or adding a class as @TParcollet propose to load model at the begning…
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
Load pretrained instances with an AutoClass - Hugging Face
The from_pretrained() method lets you quickly load a pretrained model for any architecture so you don't have to devote time and resources to...
Read more >Save and load models | TensorFlow Core
Model progress can be saved during and after training. This means a model can resume where it left off and avoid long training...
Read more >Saving and Loading Models - PyTorch
To load the models, first initialize the models and optimizers, then load the dictionary locally using torch.load() .
Read more >Loading Pre-Trained Models - Caffe2
Take advantage of the Model Zoo and grab some pre-trained models and take them for a test drive. You can find different models...
Read more >how can I load pretrained model by pytorch? ( mmfashion)
import torchvision model = torchvision.models.wide_resnet50_2(pretrained=True) for param in model.parameters(): param.required_grad = False.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A entire class would make more sense to me 😄
let me make some example for transducer with ctc pre-trained model…