Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.5k stars 1.01k forks source link

Attribute error in utils type_conversion code in latest monai version 1.3.1 #7868

Closed xlar-sanjeet closed 1 day ago

xlar-sanjeet commented 6 days ago

Describe the bug I am getting this attribute error while trying to transform data for swin unetr code.

Environment Latest monai version 1.3.1

Error --

File ~/.conda/envs/monai/lib/python3.10/site-packages/monai/utils/type_conversion.py:369, in convert_to_dst_type(src, dst, dtype, wrap_sequence, device, safe) 368 output_type: Any --> 369 if isinstance(dst, monai.data.MetaTensor): 370 output_type = monai.data.MetaTensor

AttributeError: module 'monai' has no attribute 'data'

monai_error

KumoLiu commented 3 days ago

Hi @xlar-sanjeet, I can't reproduce the issue locally, could you please share a small script to reproduce the issue? Such as:

 from monai.data import MetaTensor

Perhaps you can try to uninstall and reinstall the monai and ensure there is only one version exit.

Thanks!

KumoLiu commented 1 day ago

Will convert this one to discussion for now, feel free to create a new one, thanks.