TypeError: Exception encountered when calling layer "custom_crop_layer_2" " f"(type CustomCropLayer). #63788
Labels
comp:keras
Keras related issues
stale
This label marks the issue/pr stale - to be closed automatically if no activity
stat:awaiting response
Status - Awaiting response from author
TF 2.10
type:bug
Bug
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
binary
TensorFlow version
tf 2.10.0
Custom code
Yes
OS platform and distribution
Linux Ubuntu 20.04.4
Mobile device
No response
Python version
3.7.6
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
12.2
GPU model and memory
No response
Current behavior?
Expect:
successfully saved to tf format ckpt.
Now:
Traceback (most recent call last):
File "issue_tf2onnx_001.py", line 207, in
model.save(f'tmp/lenet5_sb', save_format='tf')
File "/opt/conda/envs/tf2onnx/lib/python3.7/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/opt/conda/envs/tf2onnx/lib/python3.7/contextlib.py", line 119, in exit
next(self.gen)
File "issue_tf2onnx_001.py", line 77, in call
indices.append(slice(0 + crop[0], shape - crop[1]))
TypeError: Exception encountered when calling layer "custom_crop_layer_2" " f"(type CustomCropLayer).
unsupported operand type(s) for -: 'NoneType' and 'int'
Call arguments received by layer "custom_crop_layer_2" " f"(type CustomCropLayer):
• args=('tf.Tensor(shape=(None, None, None, 32), dtype=float32)',)
• kwargs={'training': 'False'}
Standalone code to reproduce the issue
Relevant log output
The text was updated successfully, but these errors were encountered: