Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging

Home Page:https://monai.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Attribute error in utils type_conversion code in latest monai version 1.3.1

xlar-sanjeet opened this issue · comments

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

commented

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!

commented

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