Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metatensor method astype can't into metatensor #8202

Open
m-milena opened this issue Nov 13, 2024 · 0 comments
Open

Metatensor method astype can't into metatensor #8202

m-milena opened this issue Nov 13, 2024 · 0 comments

Comments

@m-milena
Copy link

Describe the bug
MetaTensor class has astype method. The expected behavior is to cast the data to e.g. the int type and obtain a MetaTensor. However, this function returns either torch.Tensor itself or np.array. In docs there isn't any metion about data type you will get as output. To achieve this you need to use convert_data_type function from monai.utils.

Expected behavior
Using astype method on metatensor needs to return metatensor or have additional argument output_type like in convert_data_type function.

Screenshots
image

Environment

python 3.10, pytorch 1.12.1

================================
Printing MONAI config...
================================
MONAI version: 1.4.0
Numpy version: 1.26.4
Pytorch version: 1.12.1
MONAI flags: HAS_EXT = False, USE_COMPILED = False, USE_META_DICT = False
MONAI rev id: 46a5272196a6c2590ca2589029eed8e4d56ff008
MONAI __file__: /home/<username>/anaconda3/envs/workspace/lib/python3.10/site-packages/monai/__init__.py

Optional dependencies:
Pytorch Ignite version: NOT INSTALLED or UNKNOWN VERSION.
ITK version: 5.4.0
Nibabel version: 5.1.0
scikit-image version: 0.22.0
scipy version: 1.11.1
Pillow version: 9.4.0
Tensorboard version: NOT INSTALLED or UNKNOWN VERSION.
gdown version: NOT INSTALLED or UNKNOWN VERSION.
TorchVision version: 0.13.1
tqdm version: 4.65.0
lmdb version: NOT INSTALLED or UNKNOWN VERSION.
psutil version: 6.0.0
pandas version: 2.2.3
einops version: 0.8.0
transformers version: 4.24.0
mlflow version: 2.14.0
pynrrd version: NOT INSTALLED or UNKNOWN VERSION.
clearml version: NOT INSTALLED or UNKNOWN VERSION.

For details about installing the optional dependencies, please visit:
    https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies


================================
Printing system config...
================================
System: Linux
Linux version: Ubuntu 22.04.3 LTS
Platform: Linux-6.8.0-48-generic-x86_64-with-glibc2.35
Processor: x86_64
Machine: x86_64
Python version: 3.10.12
Process name: python
Command: ['python', '-c', 'import monai; monai.config.print_debug_info()']
Open files: [popenfile(path='/home/dell/.config/Code/logs/20241113T073758/ptyhost.log', fd=37, position=0, mode='a', flags=33793), popenfile(path='/usr/share/code/resources/app/node_modules.asar', fd=38, position=51392, mode='r', flags=32768), popenfile(path='/usr/share/code/v8_context_snapshot.bin', fd=103, position=0, mode='r', flags=32768)]
Num physical CPUs: 6
Num logical CPUs: 12
Num usable CPUs: 12
CPU usage (%): [9.0, 8.3, 13.8, 8.9, 8.3, 54.5, 11.8, 12.4, 10.2, 9.0, 9.6, 54.1]
CPU freq. (MHz): 2614
Load avg. in last 1, 5, 15 mins (%): [13.1, 13.2, 15.6]
Disk usage (%): 14.4
Avg. sensor temp. (Celsius): UNKNOWN for given OS
Total physical memory (GB): 15.4
Available memory (GB): 6.7
Used memory (GB): 8.1

================================
Printing GPU config...
================================
Num GPUs: 1
Has CUDA: True
CUDA version: 11.3
cuDNN enabled: True
NVIDIA_TF32_OVERRIDE: None
TORCH_ALLOW_TF32_CUBLAS_OVERRIDE: None
cuDNN version: 8302
Current device: 0
Library compiled for CUDA architectures: ['sm_37', 'sm_50', 'sm_60', 'sm_61', 'sm_70', 'sm_75', 'sm_80', 'sm_86', 'compute_37']
GPU 0 Name: NVIDIA GeForce RTX 2060
GPU 0 Is integrated: False
GPU 0 Is multi GPU board: False
GPU 0 Multi processor count: 30
GPU 0 Total memory (GB): 5.8
GPU 0 CUDA capability (maj.min): 7.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant