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.17k stars 232 forks source link

quality level argument missing in train.py? #288

Closed qiutiantxwd closed 4 months ago

qiutiantxwd commented 5 months ago

Hello, in ./examples/train.py, when initializing the model, quality is hardcoded: https://github.com/InterDigitalInc/CompressAI/blob/743680befc146a6d8ee7840285584f2ce00c3732/examples/train.py#L272 Should we change both quality and lambda accordingly to get results that match the curves provided on the website? Since quality is not in input arguments, just want to confirm this is the correct way to do it. Thanks!

fracape commented 5 months ago

Good point, this is a bit unclear.

TL; DR: "quality" is not used in the current implementation of train.py.

When calling a model architectures from the zoo, the quality is a mandatory argument. However, since "pretrained" is False by default (i.e., we are going to train from scratch, not from the provided pretrained models), the quality is not used (any number within the range of default qualities works). Then, you can choose to load an existing checkpoint of yours, and you are free to choose the lambda.

Could be clarified but please note that the training loop is provided as an example.