Skip to content

Can't import AddChanneld in 3D DDPM Tutorial notebook #1540

Closed

Description

@kl4z-02
ImportError                               Traceback (most recent call last)
[<ipython-input-5-2ab2401f438b>](https://localhost:8080/#) in <cell line: 12>()
     10 from monai.config import print_config
     11 from monai.data import DataLoader
---> 12 from monai.transforms import AddChanneld, CenterSpatialCropd, Compose, Lambdad, LoadImaged, Resized, ScaleIntensityd
     13 from monai.utils import set_determinism
     14 from torch.cuda.amp import GradScaler, autocast

ImportError: cannot import name 'AddChanneld' from 'monai.transforms' (/usr/local/lib/python3.10/dist-packages/monai/transforms/__init__.py)

I only used the notebook as-is, connected to T4 GPU runtime in Colab and clicked run all. The others in the same line import without problems.

Environment (please complete the following information):

  • OS - Google Colab

image
MONAI version: 1.3.dev2340
Numpy version: 1.23.5
Pytorch version: 2.0.1+cu118
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 8d89083eeb8005babd7b5f76df83c1c80276cc10
MONAI file: /usr/local/lib/python3.10/dist-packages/monai/init.py

Sorry if this is stupid, I tried looking around but couldn't fix it myself. Something that could be related is that I'm not able import generative too.

image

Activity

  1. wyli commented on Oct 2, 2023

    @wyli
    Contributor

    thanks for reporting, the tutorial was updated last week to be compatible with monai 1.3 #1527, please try the latest

  2. kl4z-02 commented on Oct 2, 2023

    @kl4z-02
    Author

    Thank you, I'll try that out. Also realized after reading your message that the old tutorial notebook was for 1.2, so I was able to run that one too by installing the older version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions