question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use transfer learning ?

See original GitHub issue

https://github.com/espnet/espnet/blob/f7e3dbb8f1e011c41973c4c77403edf8ac684126/espnet/bin/asr_train.py#L182-L184

Hi, I can’t find where the --asr-model arg is used, anyone do me a favor please ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:27 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
b-flocommented, Jun 28, 2019

If you’re using the resume function as @kan-bayashi said, the pre-trained model architecture should match the architecture you specified in your training config. In your case the only mismatched parameter is odim (your output dimension with extra labels included) so two possibilities :

  • The “bigger” dictionnary you used didn’t have the same size as in the pre-trained model you use, same problem with the smaller one.
  • You use an old ESPNET model and there was a change for odim (for the extra labels I guess). But I guess it should have been obvious from the logs.

Edit : By the way if you are wondering, the shape printed in your log is the shape of the weight matrix. For example in Linear the weights are transposed before applying matmul.

1reaction
desothier1commented, Jun 22, 2019

OK, previously I used --resume <your_pretrained_model_path> for resuming, and continuing training, starting from a previously trained model, but using exactly the same train data i used previously

I mean, transfer learning, starting from a previously trained model, but using different train data. with just specifying the path to the previously trained model, --resume <your_pretrained_model_path>, this did not work.

Or do you simply mean that on top of using --resume <your_pretrained_model_path> I should change torch_resume(args.resume, trainer) into torch_load(args.resume, model) first (i guess not…)?

Thanks for your answer

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Gentle Introduction to Transfer Learning for Deep Learning
In transfer learning, we first train a base network on a base dataset and task, and then we repurpose the learned features, or...
Read more >
A Practical Tutorial With Examples for Images and Text in Keras
Transfer learning is particularly very useful when you have a small training dataset. In this case, you can, for example, use the weights...
Read more >
A Comprehensive Hands-on Guide to Transfer Learning with ...
Transfer learning is the idea of overcoming the isolated learning paradigm and utilizing knowledge acquired for one task to solve related ones.
Read more >
What Is Transfer Learning? A Guide for Deep Learning | Built In
Approaches to Transfer Learning · 1. Training a Model to Reuse it · 2. Using a Pre-Trained Model · 3. Feature Extraction.
Read more >
Transfer learning and fine-tuning | TensorFlow Core
The intuition behind transfer learning for image classification is that if a model is trained on a large and general enough dataset, this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found