Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when trying to use entropy bottleneck of compressai in my code #297

Open
takhtardeshirsoheib opened this issue Jun 5, 2024 · 1 comment

Comments

@takhtardeshirsoheib
Copy link

takhtardeshirsoheib commented Jun 5, 2024

error as below:

python train.py
Traceback (most recent call last):
File "C:\Users\sohtak\Ph.D-Sweden-France\Sweden\Phase2\Python-Codes\The_Final_versions\VAE_05062024_Bestversion\train.py", line 165, in
main()
File "C:\Users\sohtak\Ph.D-Sweden-France\Sweden\Phase2\Python-Codes\The_Final_versions\VAE_05062024_Bestversion\train.py", line 41, in main
model = CombinedVAE(latent_channels=latent_channels, pre_trained_spatial_path='./Spatial_checkpoints/vae_model_FT_epoch_200.pth')
File "C:\Users\sohtak\Ph.D-Sweden-France\Sweden\Phase2\Python-Codes\The_Final_versions\VAE_05062024_Bestversion\model.py", line 13, in init
self.entropy_bottleneck = EntropyBottleneck(latent_channels_s)
File "C:\Users\sohtak\Ph.D-Sweden-France\Sweden\Phase2\Python-Codes\The_Final_versions\VAE_05062024_Bestversion\compressai\compressai\entropy_models\entropy_models.py", line 351, in init
super().init(*args, **kwargs)
File "C:\Users\sohtak\Ph.D-Sweden-France\Sweden\Phase2\Python-Codes\The_Final_versions\VAE_05062024_Bestversion\compressai\compressai\entropy_models\entropy_models.py", line 118, in init
entropy_coder = default_entropy_coder()
File "C:\Users\sohtak\Ph.D-Sweden-France\Sweden\Phase2\Python-Codes\The_Final_versions\VAE_05062024_Bestversion\compressai\compressai\entropy_models\entropy_models.py", line 84, in default_entropy_coder
from compressai import get_entropy_coder
ImportError: cannot import name 'get_entropy_coder' from 'compressai' (unknown location)

@YodaEmbedding
Copy link
Contributor

YodaEmbedding commented Jun 6, 2024

That says the module compressai is not available in Python's paths.

Try installing CompressAI using the instructions in https://github.com/InterDigitalInc/CompressAI?tab=readme-ov-file#installation. In your case, this means creating a virtual environment, activating the virtual environment, and then pip install -e C:\Users\sohtak\Ph.D-Sweden-France\Sweden\Phase2\Python-Codes\The_Final_versions\VAE_05062024_Bestversion\compressai.

Note that CompressAI is not officially supported on Windows. However, some users have figured out how to get it running by installing the relevant compilers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants