InterDigitalInc / CompressAI

A PyTorch library and evaluation platform for end-to-end compression research
https://interdigitalinc.github.io/CompressAI/
BSD 3-Clause Clear License
1.19k stars 232 forks source link

diction keyword error #60

Closed CristinaZN closed 3 years ago

CristinaZN commented 3 years ago

Bug

To Reproduce

Steps to reproduce the behavior:

1.train your own model 2.update your own model

  1. evaluate your own model all steps are using -a bmshj2018-factorized -p checkpoint_best_loss.pth.tar

Expected behavior

CompressAI/compressai/models/priors.py", line 161, in from_state_dict: N = state_dict["g_a.0.weight"].size(0) requires a diction including keywards "g_a.xxxxxx", but this item is in the `state_dict["state_dict"]["g_a.0.weght"]

there are also some lines using state_dict, where the same erros happened

Additional context

jbegaint commented 3 years ago

yes, when using the example training script the checkpoints contain the network state_dict and other information regarding the training process.

If you use compressai.tools.update_model or manually extract the state_dict from the checkpoints this should not happen.