jmliu206 / LIC_TCM

MIT License
144 stars 22 forks source link

Cannot run #6

Closed RoneChen closed 1 year ago

RoneChen commented 1 year ago

Here is the error,

Traceback (most recent call last):
  File "./train.py", line 427, in <module>
    main(sys.argv[1:])
  File "./train.py", line 364, in main
    net = TCM(config=[2,2,2,2,2,2], head_dim=[8, 16, 32, 32, 16, 8], drop_path_rate=0.0, N=args.N, M=320)
  File "/home/rong/LIC-TCM/models/tcm.py", line 312, in __init__
    super().__init__(entropy_bottleneck_channels=N)
  File "/home/rong/anaconda3/envs/LIC-TCM/lib/python3.8/site-packages/torch/nn/modules/module.py", line 445, in __init__
    raise TypeError("{}.__init__() got an unexpected keyword argument '{}'"
TypeError: TCM.__init__() got an unexpected keyword argument 'entropy_bottleneck_channels'

and my command,

CUDA_VISIBLE_DEVICES='0' python -u ./train.py -d ./data/ --cuda --N 128 --lambda 0.05 --epochs 50 --lr_epoch 45 48 --save_path ./checkpoint/ --save --checkpoint ./checkpoint/

There is not a argument called entropy_bottleneck_channels I think. What should I do?

jmliu206 commented 1 year ago

I think it might be a compressai version issue. I used compressai version 1.2.0, you can try using the same version.

RoneChen commented 1 year ago

Oh, yes. I reinstall the compressai, and it works! Thank you very much!

calvindongzw commented 1 year ago

Hi I got the same issue, please see the following:

File "/WAVE/users/unix/zdong/Documents/Research/LIC/LIC_TCM/eval.py", line 164, in main(sys.argv[1:]) File "/WAVE/users/unix/zdong/Documents/Research/LIC/LIC_TCM/eval.py", line 86, in main net = TCM(config=[2,2,2,2,2,2], head_dim=[8, 16, 32, 32, 16, 8], drop_path_rate=0.0, N=128, M=320) File "/WAVE/users/unix/zdong/Documents/Research/LIC/LIC_TCM/models/tcm.py", line 313, in init super().init(entropy_bottleneck_channels=N) File "/WAVE/apps/conda/envs/PyTorch/2.0.0.20230418-GPU/lib/python3.9/site-packages/torch/nn/modules/module.py", line 445, in init raise TypeError("{}.init() got an unexpected keyword argument '{}'" TypeError: TCM.init() got an unexpected keyword argument 'entropy_bottleneck_channels'

and my compressai is the latest version 1.2.4. Can you help with this issue? Thank you!

RoneChen commented 1 year ago

I fixed this problem by reinstalling compressai (1.2.0)

calvindongzw commented 1 year ago

Oh, yes. I find only 1.2.0 works. Thanks for help!

adityak55 commented 1 year ago

Hi,I've got the Dataset Issue,Is it possible for anyone to share the Dataset which you've used for executing this code

calvindongzw commented 1 year ago

Hi,I've got the Dataset Issue,Is it possible for anyone to share the Dataset which you've used for executing this code

It would be better to provide your logs.

I assume you were mentioning training datasest. The original data read-in scheme (I believe this is provided by Compressai) doesn't work for downloaded ImageNet because of the structure of directory. The original one only works when the directory structure is: Root path --> train --> data ---> images.xxx, this format works for downloaded Openimage dataset. Therefore, if you are using any datasets that are different with such directory structure, you may need to make minor changes to the codes of data read-in.

wonlee2019 commented 11 months ago

I change the "super().init(entropy_bottleneck_channels=N)" into "super().init()", and it works. I wonder whether there is a mistake.