instruct-pix2pix icon indicating copy to clipboard operation
instruct-pix2pix copied to clipboard

VectorQuantizer2 error

Open kemaleksioglu opened this issue 2 years ago • 16 comments

ImportError: cannot import name 'VectorQuantizer2' from 'taming.modules.vqvae.quantize' I'm getting an error like ... What could be the reason for this?

kemaleksioglu avatar Jan 19 '23 19:01 kemaleksioglu

Can you offer a bit more context? What are you trying to run?

holynski avatar Jan 19 '23 19:01 holynski

When I want to run "edit_app.py" it gives this error

kemaleksioglu avatar Jan 19 '23 19:01 kemaleksioglu

I'm not able to reproduce this error. Have you installed the dependencies and downloaded a checkpoint?

conda env create -f environment.yaml
conda activate ip2p
bash scripts/download_checkpoints.sh

holynski avatar Jan 19 '23 19:01 holynski

I'm not able to reproduce this error. Have you installed the dependencies and downloaded a checkpoint?

conda env create -f environment.yaml
conda activate ip2p
bash scripts/download_checkpoints.sh

Yes, I did these steps.

kemaleksioglu avatar Jan 19 '23 19:01 kemaleksioglu

Did the environment creation (the first command) return any errors?

holynski avatar Jan 19 '23 23:01 holynski

Got the same error. After googling, I found the command: pip install taming-transformers-rom1504 It worked until I get another error down the line... Will create an issue soon

BriceChivu avatar Jan 20 '23 01:01 BriceChivu

I also had to downgrade the cudatoolkit package to version 9.0 (I was getting an error in the creation of the conda env).

BriceChivu avatar Jan 20 '23 01:01 BriceChivu

Got the same error. After googling, I found the command: pip install taming-transformers-rom1504 It worked until I get another error down the line... Will create an issue soon

pip install taming-transformers-rom1504 helped me solve the problem. But now I'm getting an error "AssertionError: Torch not compiled with CUDA enabled". I guess I need to downgrade too.

kemaleksioglu avatar Jan 20 '23 01:01 kemaleksioglu

Thanks for the updates. Let me know once you figure out a working formula, and we can figure out how to integrate a fix for your systems into the current environment.yaml requirements file.

holynski avatar Jan 20 '23 01:01 holynski

Got the same error. After googling, I found the command: pip install taming-transformers-rom1504 It worked until I get another error down the line... Will create an issue soon

pip install taming-transformers-rom1504 helped me solve the problem. But now I'm getting an error "AssertionError: Torch not compiled with CUDA enabled". I guess I need to downgrade too.

Same here. Haven't found a solution to that...

BriceChivu avatar Jan 20 '23 01:01 BriceChivu

sorry to chime in with unrelated post - but @holynski I guess you saw https://github.com/haha-lisa/RDM-Region-Aware-Diffusion-Model ? seems like there's some overlap. need to explore papers and code more.

best to install pytorch with cuda from the selected option / seems conda is installing cpu option by default. https://pytorch.org/get-started/locally/

johndpope avatar Jan 20 '23 10:01 johndpope

Have you try this bash scripts/download_checkpoints.sh

Kundanagrawalofficial avatar Jan 21 '23 19:01 Kundanagrawalofficial

The error message "ImportError: cannot import name 'VectorQuantizer2' from 'taming.modules.vqvae.quantize'" suggests that there is a problem with the import statement for the 'VectorQuantizer2' module from the 'taming.modules.vqvae.quantize' package.

There could be a few reasons for this error:

1.The package 'taming' is not installed on your system, or it's not in the correct location. Make sure that the package is installed and that the import statement is pointing to the correct location.

2.The module 'VectorQuantizer2' does not exist in the package 'taming.modules.vqvae.quantize'. You can check the package documentation to see if it's been replaced or removed in a later version.

3.There's a naming collision with another module or package in your code. Make sure that you don't have any modules or packages with the same name in your codebase.

4.There's a typo in your import statement. Make sure that the package, module, and submodule names are spelled correctly.

Try to resolve the issue by checking the package location, package version, module name and import statement. Also, you can try to install the package again, or use a different version of the package.

Kundanagrawalofficial avatar Jan 22 '23 07:01 Kundanagrawalofficial

Got the same error. After googling, I found the command: pip install taming-transformers-rom1504 It worked until I get another error down the line... Will create an issue soon

pip install taming-transformers-rom1504 helped me solve the problem. But now I'm getting an error "AssertionError: Torch not compiled with CUDA enabled". I guess I need to downgrade too.

Have you solved the issue?

BriceChivu avatar Jan 23 '23 08:01 BriceChivu