SapienzaNLP / spring

SPRING is a seq2seq model for Text-to-AMR and AMR-to-Text (AAAI2021).
Other
126 stars 23 forks source link

loaded state dict contains a parameter group that doesn't match the size of optimizer's group #21

Open Spongeorge opened 1 year ago

Spongeorge commented 1 year ago

When trying to run the command (checkpoint is the AMR3.parsing-1.0.tar.bz2 one)

python bin/train.py --config configs/config.yaml --direction amr --checkpoint /content/drive/MyDrive/AMRS/SPRING_AMR3_parser.pt

I get the error

Traceback (most recent call last):
  File "bin/train.py", line 430, in <module>
    fp16=args.fp16,
  File "bin/train.py", line 76, in do_train
    optimizer.load_state_dict(torch.load(checkpoint)['optimizer'])
  File "/usr/local/envs/myenv/lib/python3.7/site-packages/torch/optim/optimizer.py", line 116, in load_state_dict
    raise ValueError("loaded state dict contains a parameter group "
ValueError: loaded state dict contains a parameter group that doesn't match the size of optimizer's group

Environment

# packages in environment at /usr/local/envs/myenv:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             5.1                       1_gnu  
appdirs                   1.4.4                    pypi_0    pypi
ca-certificates           2023.01.10           h06a4308_0  
cached-property           1.5.2                    pypi_0    pypi
certifi                   2022.12.7        py37h06a4308_0  
charset-normalizer        3.1.0                    pypi_0    pypi
click                     8.1.3                    pypi_0    pypi
colorama                  0.4.6                    pypi_0    pypi
docker-pycreds            0.4.0                    pypi_0    pypi
filelock                  3.12.0                   pypi_0    pypi
future                    0.18.3                   pypi_0    pypi
gitdb                     4.0.10                   pypi_0    pypi
gitpython                 3.1.31                   pypi_0    pypi
idna                      3.4                      pypi_0    pypi
importlib-metadata        6.6.0                    pypi_0    pypi
joblib                    1.2.0                    pypi_0    pypi
ld_impl_linux-64          2.38                 h1181459_1  
libffi                    3.4.2                h6a678d5_6  
libgcc-ng                 11.2.0               h1234567_1  
libgomp                   11.2.0               h1234567_1  
libstdcxx-ng              11.2.0               h1234567_1  
lxml                      4.9.2                    pypi_0    pypi
ncurses                   6.4                  h6a678d5_0  
networkx                  2.6.3                    pypi_0    pypi
numpy                     1.21.6                   pypi_0    pypi
openssl                   1.1.1t               h7f8727e_0  
packaging                 23.1                     pypi_0    pypi
pathtools                 0.1.2                    pypi_0    pypi
penman                    1.2.2                    pypi_0    pypi
pip                       22.3.1           py37h06a4308_0  
portalocker               2.7.0                    pypi_0    pypi
protobuf                  4.22.3                   pypi_0    pypi
psutil                    5.9.5                    pypi_0    pypi
python                    3.7.16               h7a1cb2a_0  
pytorch-ignite            0.4.11                   pypi_0    pypi
pyyaml                    6.0                      pypi_0    pypi
readline                  8.2                  h5eee18b_0  
regex                     2022.10.31               pypi_0    pypi
requests                  2.29.0                   pypi_0    pypi
sacrebleu                 2.3.1                    pypi_0    pypi
sacremoses                0.0.53                   pypi_0    pypi
sentencepiece             0.1.98                   pypi_0    pypi
sentry-sdk                1.21.1                   pypi_0    pypi
setproctitle              1.3.2                    pypi_0    pypi
setuptools                65.6.3           py37h06a4308_0  
six                       1.16.0                   pypi_0    pypi
smatch                    1.0.4                    pypi_0    pypi
smmap                     5.0.0                    pypi_0    pypi
spring-amr                1.0                       dev_0    <develop>
sqlite                    3.41.2               h5eee18b_0  
tabulate                  0.9.0                    pypi_0    pypi
tk                        8.6.12               h1ccaba5_0  
tokenizers                0.7.0                    pypi_0    pypi
torch                     1.5.0                    pypi_0    pypi
tqdm                      4.65.0                   pypi_0    pypi
transformers              2.11.0                   pypi_0    pypi
typing-extensions         4.5.0                    pypi_0    pypi
urllib3                   1.26.15                  pypi_0    pypi
wandb                     0.15.0                   pypi_0    pypi
wheel                     0.38.4           py37h06a4308_0  
xz                        5.2.10               h5eee18b_1  
zipp                      3.15.0                   pypi_0    pypi
zlib                      1.2.13               h5eee18b_0 

Any ideas as to what I'm doing wrong? Thanks in advance.