Project-MONAI / GenerativeModels

MONAI Generative Models makes it easy to train, evaluate, and deploy generative models and related applications
Apache License 2.0
555 stars 78 forks source link

Trouble with AutoencoderKL #484

Open khanhhoaa19 opened 2 months ago

khanhhoaa19 commented 2 months ago

Hi I have a trouble when import AutoencoderKL from generative image

marksgraham commented 2 months ago

Please try updating monai-generative to the latest version

khanhhoaa19 commented 2 months ago

I am using the latest version (monai-generative version 0.2.3 and monai version 1.3.0) downloaded from PyPI, but I am still encountering the same error

marksgraham commented 2 months ago

What happens when you print model.use_checkpointing? Can you share a minimal version of your code that reproduces this problem that I could try to play with?

khanhhoaa19 commented 2 months ago

When I call the generative-monai

from generative.losses import PatchAdversarialLoss, PerceptualLoss from generative.networks.nets import AutoencoderKL, PatchDiscriminator

The terminal encountered an error related to 'model.use_checkpointing'

marksgraham commented 2 months ago

This suggests a problem with your install to me. If i create a fresh environment and run pip install monai-generative then I can run no problem:

from generative.networks.nets import AutoencoderKL
net = AutoencoderKL(spatial_dims=2)
print(net.use_checkpointing)

I would recommend trying again in a fresh virtual environment

virginiafdez commented 2 weeks ago

Has this issue been resolved with the last suggestion?