AttributeError: module 'monai.transforms' has no attribute 'EnsureTyped' #670
-
Hello I am trying to use EnsureTyped transform Hovewer I get error like below
in code
configuration info
Other coonfiguration data I installed monai and pytorch using commands below
What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Instead of above, Use from monai.transforms import *
val_transforms = Compose(
[
LoadImaged(keys=["image", "label"]),
EnsureChannelFirstd(keys=["image", "label"]),
Spacingd(keys=["image", "label"], pixdim=(
1.0, 1.0, 1.0), mode=("bilinear", "nearest")),
Orientationd(keys=["image", "label"], axcodes="RAS"),
CropForegroundd(keys=["image", "label"], source_key="image"),
EnsureTyped(keys=["image", "label"]),
]
) If still not working, then possibly raise the question/issue at https://github.com/Project-MONAI/MONAI |
Beta Was this translation helpful? Give feedback.
-
Sorry ! i forgot to post it setting python version 3.7 solved the issue for me 🙂 |
Beta Was this translation helpful? Give feedback.
Sorry ! i forgot to post it setting python version 3.7 solved the issue for me 🙂