Open mayurmunshi opened 3 months ago
Hi @mayurmunshi ,
This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.
Hello,
The code snippet is as follows
inputs = Input(input_shape) custom_layer = ZeroPadding3D((3,3,1)) time_distributed_custom_layer = TimeDistributed(custom_layer) x = time_distributed_custom_layer(inputs)
On trying to execute this step at model.fit stage I am getting following error message :
epochs = 20 ----> 2 model.fit( 3 train_dataset, 4 validation_data=validation_dataset, 5 epochs=epochs, 6 shuffle=True,batch_size=16, 7 verbose=2, 8 callbacks=[checkpoint_cb,tensorboard_cb,early_stopping_cb] 9 )
File ~/.local/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py:70, in filter_traceback.tf.debugging.disable_traceback_filtering()
---> 70 raise e.with_traceback(filtered_tb) from None
71 finally:
72 del filtered_tb
File /tmp/autograph_generated_filecb7v_b6i.py:15, in outer_factory.
ValueError: in user code:
File "/home/user/.local/lib/python3.10/site-packages/keras/src/engine/training.py", line 1401, in train_function *
return step_function(self, iterator)
File "/home/user/.local/lib/python3.10/site-packages/keras/src/engine/training.py", line 1384, in step_function **
outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/home/user/.local/lib/python3.10/site-packages/keras/src/engine/training.py", line 1373, in run_step **
outputs = model.train_step(data)
File "/home/user/.local/lib/python3.10/site-packages/keras/src/engine/training.py", line 1150, in train_step
y_pred = self(x, training=True)
File "/home/user/.local/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
ValueError: Exception encountered when calling layer 'time_distributed_21' (type TimeDistributed).
as_list() is not defined on an unknown TensorShape.
Call arguments received by layer 'time_distributed_21' (type TimeDistributed):
• inputs=tf.Tensor(shape=<unknown>, dtype=float32)
• training=True
• mask=None
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
Yes
Source
source
TensorFlow version
2.15
Custom code
Yes
OS platform and distribution
Linux Ubuntu
Mobile device
No response
Python version
3.10
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
ValueError: Please initialize
TimeDistributed
layer with atf.keras.layers.Layer
instance. Received: KerasTensor(type_spec=TensorSpec(shape=(None, 3, 32, 32, 16, 256), dtype=tf.float32, name=None), name='activation_19/Relu:0', description="created by layer 'activation_19'")Standalone code to reproduce the issue
Relevant log output