yoshitomo-matsubara / sc2-benchmark

[TMLR] "SC2 Benchmark: Supervised Compression for Split Computing"
https://yoshitomo-matsubara.net/sc2-benchmark/
MIT License
24 stars 10 forks source link

train_config = config['train'] gives "KeyError: 'train'" #142

Closed andreamigliorati closed 4 months ago

andreamigliorati commented 4 months ago

I'm trying to run the image classification script as in the following:

bash script/neural_input_compression/ilsvrc2012-image_classification.sh factorized_prior-resnet50 8

which actually runs smoothly. I want to train my model so I removed the -test_only flag from the sh script but I get the following error:

Traceback (most recent call last):
  File "/media/RAID/migliorati/coding_machines/sc2-benchmark-main/script/task/image_classification.py", line 235, in <module>
    main(argparser.parse_args())
  File "/media/RAID/migliorati/coding_machines/sc2-benchmark-main/script/task/image_classification.py", line 209, in main
    train(teacher_model, student_model, dataset_dict, ckpt_file_path, device, device_ids, distributed, config, args)
  File "/media/RAID/migliorati/coding_machines/sc2-benchmark-main/script/task/image_classification.py", line 135, in train
    train_config = config['train']

I'm assuming that by removing the flag I can do training following what it's stated ("If you want to train models yourself by the baselines, exclude -test_only from the following commands") in your older repository ([https://github.com/yoshitomo-matsubara/supervised-compression]) but of course I might be wrong. How to solve this? Thanks in advance

yoshitomo-matsubara commented 4 months ago

Hi @andreamigliorati

It is an expected behavior. script/neural_input_compression/ is using pretrained neural image compression models as stated in the README and our SC2 benchmark paper (TMLR), and you cannot train the models with the config files.

If you want to, you need to complete train section in the config by yourself like config files for supervised compression.