ANTsX / ANTsPyNet

Pre-trained models and utilities for deep learning on medical images in Python
https://antspynet.readthedocs.io
Apache License 2.0
181 stars 28 forks source link

error when using super_resolution #114

Open wdddddd opened 1 month ago

wdddddd commented 1 month ago

Code: import ants import antspynet

t1 = ants.image_read(antspynet.get_antsxnet_data('mprage_hippmapp3r')) t1_lr = ants.resample_image(t1, (4, 4, 4), use_voxels=False) ants.plot(t1_lr) t1_sr = antspynet.mri_super_resolution(t1_lr, verbose=True) ants.plot(t1_sr)

Question: in Operation.from_config(cls, config) 208 return cls(**config) 209 except Exception as e: --> 210 raise TypeError( 211 f"Error when deserializing class '{cls.name}' using " 212 f"config={config}.\n\nException encountered: {e}" 213 )

      TypeError: Error when deserializing class 'Conv3DTranspose' using config={'name': 'conv3d_transpose_4', 'trainable': True, 'dtype': 'float32', 'filters': 64, 'kernel_size': [6, 6, 6], 'strides': [2, 2, 2], 'padding': 'same', 'data_format': 'channels_last', 'groups': 1, 'activation': 'linear', 'use_bias': True, 'kernel_initializer': {'class_name': 'GlorotUniform', 'config': {'seed': None}}, 'bias_initializer': {'class_name': 'Zeros', 'config': {}}, 'kernel_regularizer': None, 'bias_regularizer': None, 'activity_regularizer': None, 'kernel_constraint': None, 'bias_constraint': None, 'output_padding': None}.

Thanks!

Exception encountered: Unrecognized keyword arguments passed to Conv3DTranspose: {'groups': 1}

ntustison commented 1 month ago

Probably incompatible tensorflow/keras. What is your system configuration?

ntustison commented 1 month ago

Also, make sure you've updated recently because these issues are continuously getting fixed.

wdddddd commented 1 month ago

Thanks for your responses, this error is generated based on the environment of python3.11, and I re-install a new environment of python3.8, this problem doesn't happen. Thank you again. I appreciate your work, it's great!