Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is SAM-Unet incremental training possible? #25

Open
Tony-Duan2020 opened this issue Oct 25, 2024 · 1 comment
Open

is SAM-Unet incremental training possible? #25

Tony-Duan2020 opened this issue Oct 25, 2024 · 1 comment

Comments

@Tony-Duan2020
Copy link

Hi,

Thank you for the excellent code.
I would like to know if incremental training is possible with SAM2-Unet.

I tried using the checkpoint 'SAM2-UNet-xx.pth' as input for 'hiera_path' in the train.py but I encountered the following errors:

  File "D:\MyProjects\SAM2-UNet\sam2\build_sam.py", line 81, in _load_checkpoint
    sd = torch.load(ckpt_path, map_location="cpu")["model"]
KeyError: 'model'

I hope to perform incremental training on my model. For example, I collected data A and trained a model this time. Later, I want to build on that model to train with data B. What are some good suggestions for this process?"

@xiongxyowo
Copy link
Collaborator

Hi, the parameter --hiera-path is set to None (see test.py) when performing testing or incremental training, as the encoder parameters have been overwritten and saved in the new checkpoint. Our original code does not support resuming training. Please refer to issue #20 for guidance on how to perform incremental training. Additionally, since you are continue training on a different dataset, you may only need to save the model's 'state_dict'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants