ANTsPyNet icon indicating copy to clipboard operation
ANTsPyNet copied to clipboard

error when using super_resolution

Open wdddddd opened this issue 2 years ago • 3 comments

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}

wdddddd avatar May 19 '24 13:05 wdddddd

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

ntustison avatar May 19 '24 15:05 ntustison

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

ntustison avatar May 19 '24 15:05 ntustison

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!

wdddddd avatar May 19 '24 15:05 wdddddd