Closed VachanVY closed 8 months ago
@VachanVY Could you use tf.shape to access dynamic shapes within computations and reshape tensors as needed, ensuring compatibility with layers and operations. Please consider using functions like tf.reshape or tf.expand_dims as well and let us know? Thank you!
Could you use tf.shape to access dynamic shapes within computations
I've used both tf.shape
and Tensor.shape
, but getting error as mentioned in the issue
reshape tensors as needed, ensuring compatibility with layers and operations.
But I don't want to reshape the tensors, should I just do it to ensure compatibility with layers and operations as you said? That means it's a bug right? And I'll do as you said and share the details.
@sushreebarsa If you don't mind could you please check the notebook DETR once, it's difficult to follow up like this. Thank You.
Hi @VachanVY ,
We won't debug user code particularly when its a long notebook due to nour bandwidth issues. I request you to submit a minimal code snippet that can reproduce the error so that it can be fixed or debugged. For support issues you can post the same at tensorflow-forum or stackoverflow.
Individual components work, but only while training there's a problem, so the entire code is required to reproduce the issue.
Hi @VachanVY ,
Can you please import the code to google colab, execute it and then submit a colab gist here ?
@SuryanarayanaY But I've provided a Kaggle notebook link.
Issue type
Bug
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.13.0
Custom code
Yes
OS platform and distribution
No response
Mobile device
No response
Python version
3.10.12
Bazel version
No response
GCC/compiler version
No response
CUDA/cuDNN version
No response
GPU model and memory
No response
Current behavior?
I've coded the DETR object detection pipeline from scratch in Tensorflow.
I've tested all the individual components in the pipeline and it works. But when I start training it on my dataset (in
tf.data.Dataset
form) I get an errorThis mostly due to the behaviour of
Tensor.shape
andtf.shape
.Tensor.shape
returnsNone
in it's shape andtf.shape
returns something likeTensor("Shape_2:0", shape=(1,), dtype=int32)
which is not the shape of the tensorPlease help. Thank you.
Standalone code to reproduce the issue
Kaggle Notebook to reproduce error Make a copy of the notebook to reproduce this issue.
Relevant log output