rs4a icon indicating copy to clipboard operation
rs4a copied to clipboard

Pretrained imagenet models not compatible with current code

Open alevine0 opened this issue 4 years ago • 0 comments

The code is not compatible with the provided pertained imagenet models, in that it does not provide required 'norm' and 'log_sig' elements in the state_dict. I think this must be due to a change in the normalization technique used since training. Could you provide information/code for the original normalization method? Thanks.

bash-4.2$ python3 -m src.test --output-dir=imagenet --dataset-skip=1000 --noise=Uniform --sigma 0.5 --experiment-name=imagenet_uniform_0.5 --model ResNet --noise-batch-size=128 --save-path=imagenet/imagenet_uniform_0.5/imagenet_uniform_050.pt --dataset imagenet /nfshomes/alevine0/.local/lib/python3.7/site-packages/statsmodels/tools/_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead. import pandas.util.testing as tm Traceback (most recent call last): File "/home/alevine0/miniconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/home/alevine0/miniconda3/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/alevine0/rs4a/src/test.py", line 59, in <module> model.load_state_dict(saved_dict) File "/home/alevine0/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1045, in load_state_dict self.__class__.__name__, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for ResNet: Missing key(s) in state_dict: "norm.module.mu", "norm.module.log_sig".

alevine0 avatar Jan 07 '21 08:01 alevine0