Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value Error when calling get_detr_model #53

Open
tobilab opened this issue Jul 22, 2024 · 0 comments
Open

Value Error when calling get_detr_model #53

tobilab opened this issue Jul 22, 2024 · 0 comments

Comments

@tobilab
Copy link

tobilab commented Jul 22, 2024

I'am using your code with Tensorflow version 2.15.0 and Keras version 3.0.4

If i call the lines of get_detr_model(config,...) then an Value Error arises with the following message:
ValueError: A KerasTensor cannot be used as input to a TensorFlow function. A KerasTensor is a symbolic placeholder for a shape and dtype, used when constructing Keras Functional models or Keras Functions. You can only use it as input to a Keras layer or a Keras operation (from the namespaces keras.layersandkeras.operations)

The error seems to be caused by line 172 in detr.py: masks = tf.zeros((tf.shape(x)[0], tf.shape(x)[1], tf.shape(x)[2]), tf.bool).

The code that i use is from your tutorial here at the section Load the detr model.

What am i doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant