nnUNet icon indicating copy to clipboard operation
nnUNet copied to clipboard

UserWarning: positional arguments and argument "destination" are deprecated. nn.Module.state_dict will not accept them in the future

Open DSRajesh opened this issue 2 years ago • 1 comments

Getting following error while calling the segmentation model in our project. Can anyone please let me know how to get rid of this warning message please ?

/venv/lib/python3.8/site-packages/torch/nn/modules/module.py:1383: UserWarning: positional arguments and argument "destination" are deprecated. nn.Module.state_dict will not accept them in the future. Refer to https://pytorch.org/docs/master/generated/torch.nn.Module.html#torch.nn.Module.state_dict for details.

Looks like

"load_pickle(pkl_file)"

or

"params = [torch.load(i, map_location=torch.device('cpu')) for i in [model]]"

is the source of this warning.

Thank you

DSRajesh avatar Jun 11 '22 16:06 DSRajesh

Can you please tell me step by step what you did so that I can try to reproduce this?

FabianIsensee avatar Aug 23 '22 11:08 FabianIsensee

Hi @DSRajesh,

did you manage to solve your problem?

Best, Yannick

ykirchhoff avatar Jul 31 '23 17:07 ykirchhoff