You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conv3DTranspose issue with torch backend padding arguments (padding=same) and output_padding=1) lead to a Torch output_padding (1) that is greater than strides (1).
#20949
Open
pure-rgb opened this issue
Feb 23, 2025
· 2 comments
Currently a warning is given but what is the solution or workaround?
ValueError: Exception encountered when calling Conv3DTranspose.call().
The padding arguments (padding=same) and output_padding=1) lead to a Torch output_padding (1) that is greater than strides (1). This is not supported. You can change the padding arguments, kernel or stride, or run on another backend.
Arguments received by Conv3DTranspose.call():
• inputs=torch.Tensor(shape=torch.Size([16, 96, 6, 6, 128]), dtype=float32)
The text was updated successfully, but these errors were encountered:
This works in tf and jax, output: (1, 8, 8, 8, 32). But in torch backend, it gives
/opt/conda/lib/python3.10/site-packages/keras/src/backend/common/backend_utils.py:91: UserWarning: You might experience inconsistencies across backends when calling conv transpose with kernel_size=2, stride=1, dilation_rate=1, padding=same, output_padding=1.
warnings.warn(
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[2], line 8
1 a = np.ones((1,8,8,8,16), dtype=np.float32)2 x = keras.layers.Conv3DTranspose(332,4 kernel_size=2,5 strides=1,6 padding='same',7 )---->8 output = x(a)9 print(output.shape)File /opt/conda/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py:122, in filter_traceback.<locals>.error_handler(*args, **kwargs)119 filtered_tb = _process_traceback_frames(e.__traceback__)120 # To get the full stack trace, call:121 # `keras.config.disable_traceback_filtering()`-->122 raise e.with_traceback(filtered_tb) from None123 finally:124 del filtered_tbFile /opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)1516 return self._compiled_call_impl(*args, **kwargs) # type: ignore[misc]1517 else:->1518 return self._call_impl(*args,**kwargs)File /opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, **kwargs)1522 # If we don't have any hooks, we want to skip the rest of the logic in1523 # this function, and just call forward.1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks1525 or _global_backward_pre_hooks or _global_backward_hooks1526 or _global_forward_hooks or _global_forward_pre_hooks):->1527 return forward_call(*args,**kwargs)1529 try:1530 result = NoneValueError: Exception encountered when calling Conv3DTranspose.call().The padding arguments (padding=same) and output_padding=1) lead to a Torch output_padding (1) that is greater than strides (1). This is not supported. You can change the padding arguments, kernel or stride, or run on another backend. Arguments received by Conv3DTranspose.call(): • inputs=torch.Tensor(shape=torch.Size([1, 8, 8, 8, 16]), dtype=float32)
I ended up with the following issue keras-team/keras-core#774
Currently a warning is given but what is the solution or workaround?
ValueError: Exception encountered when calling Conv3DTranspose.call().
The padding arguments (padding=same) and output_padding=1) lead to a Torch output_padding (1) that is greater than strides (1). This is not supported. You can change the padding arguments, kernel or stride, or run on another backend.
Arguments received by Conv3DTranspose.call():
• inputs=torch.Tensor(shape=torch.Size([16, 96, 6, 6, 128]), dtype=float32)
The text was updated successfully, but these errors were encountered: