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

How to evaluate the example model with CompressAI utils? #14

Closed beiluo97 closed 3 years ago

beiluo97 commented 3 years ago

Thanks for the great work! After I train the example network like this, python3 examples/train.py -d /path/to/my/image/dataset/ --epochs 300 -lr 1e-4 --batch-size 16 --cuda --save I'm trying to evaluate the performance of the model. But I couldn't find any tips about use the command line to evaluate the example model. The tips of evaluation part is that python3 -m compressai.utils.eval_model checkpoint /path/to/images/folder/ -a $ARCH -p $MODEL_CHECKPOINT... Which requires to enter the architecture of the model, and all of the arch are the pre-trained. So is there any method to use command line to call CompressAI utils to evaluate a new model?

jbegaint commented 3 years ago

Currently no. If you want to evaluate your own model implementation you would have to update the eval_model script to support it. There's no way in regular PyTorch to instantiate a model from just the state_dict. We might have a better support for torchscript in the future, which could help.

beiluo97 commented 3 years ago

Currently no. If you want to evaluate your own model implementation you would have to update the eval_model script to support it. There's no way in regular PyTorch to instantiate a model from just the state_dict. We might have a better support for torchscript in the future, which could help.

Thanks for your reply so much!