Visual-Behavior / detr-tensorflow

Tensorflow implementation of DETR : Object Detection with Transformers
MIT License
168 stars 53 forks source link

Value Error when calling get_detr_model #53

Open tobilab opened 2 months ago

tobilab commented 2 months ago

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 namespaceskeras.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?