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 save / load part of checkpoint?

See original GitHub issue

❓ Questions/Help/Support

Hi @vfdev-5 ,

I have a feature request from Clara users for transfer learning: I trained a model with 4 output classes, then I want to load the checkpoint for a 3 classes task. How to save weights except for the last output layer in ignite Checkpoint handler? Or skip the last layer when loading checkpoint in the handler?

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Nic-Macommented, Apr 4, 2021

Hi @vfdev-5 ,

Thanks for your detailed solutions! I prefer the first solution because we may not know the exact layers affected by class numbers, for example, maybe a different input channel number will affect several convolution layers. Maybe we can enhance the MONAI CheckpointLoader with the strick_shape option later, I submitted ticket: https://github.com/Project-MONAI/MONAI/issues/1939

Thanks.

0reactions
vfdev-5commented, May 4, 2021

I think we can close this issue as solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Saving and loading a general checkpoint in PyTorch
A common PyTorch convention is to save these checkpoints using the .tar file extension. To load the items, first initialize the model and...
Read more >
Save and load models | TensorFlow Core
Save and load models ; Setup. Installs and imports; Get an example dataset; Define a model ; Save checkpoints during training. Checkpoint callback ......
Read more >
How to Save and Load Models in PyTorch - Wandb
This article is a tutorial that covers how to correctly save and load your trained machine learning models in PyTorch using Weights &...
Read more >
How to save and load models in Pytorch - YouTube
Let's say you have a model that is working but now you want to be able to save a checkpoint and load it...
Read more >
Load that &%$*# Checkpoint! - Towards Data Science
Just load what you need. You might not want all of the info that I loaded in this checkpoint, but I'm including the...
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