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

nnunetv2,save weight and network to a pth file #2632

Open
qwertyuiop194 opened this issue Dec 5, 2024 · 2 comments
Open

nnunetv2,save weight and network to a pth file #2632

qwertyuiop194 opened this issue Dec 5, 2024 · 2 comments
Assignees

Comments

@qwertyuiop194
Copy link

unet = nnUNetTrainer(plans=plan_json, configuration='3d_fullres', fold=0, dataset_json=data_json)
unet.initialize()
#print(unet.network)
#print(model_weight)
unet.network.load_state_dict(model_weight,strict=False)
trace_model = torch.jit.trace(unet.network, torch.randn(pp_patchsize).to("cuda"))
torch.jit.save(trace_model, os.path.join(output, 'nnunet.jit.pt'))

Execute the above code, unable to save, please help,thanks

@qwertyuiop194
Copy link
Author

Excuse me again, do you have a solution? Thank you very much

@anxingle
Copy link
Contributor

Can you give more detail about your issue? like wrong info

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

3 participants