tensorflow/addons

GIoU values not in the admitted range (Question)

gianfrancodemarco opened this issue · 6 comments

System information

  • TensorFlow version and how it was installed (source or binary): 2.9.1
  • TensorFlow-Addons version and how it was installed (source or binary): 0.19.0
  • Python version: Python 3.8.10

Describe the bug
I've looked at the paper introducing GIoU and my understanding is that admitted values for the loss range from -1 to 1.
Trying to use it as a loss to train an object recognition model, I get GIoU values well over 1, and I don't know how to interpret them.
This happens even in the tensorflow addons example:

gl = tfa.losses.GIoULoss()
boxes1 = tf.constant([[4.0, 3.0, 7.0, 5.0], [5.0, 6.0, 10.0, 7.0]])
boxes2 = tf.constant([[3.0, 4.0, 6.0, 8.0], [14.0, 14.0, 15.0, 15.0]])
loss = gl(boxes1, boxes2)
# loss = 1.5041

How should this results be interpreted?

bhack commented

Can you try the same with the GIOU loss in Keras-CV https://github.com/keras-team/keras-cv ?

@bhack I've tried the IoULoss since the GIoULoss is not released yet, howewer the loss is stuck at 1.00 and the network is not learning, while improves using a classic mse loss. I'm overfitting on just on batch of images, using:
IoULoss(bounding_box_format="xyxy", mode="linear")

bhack commented

Try with pip install git+https://github.com/keras-team/keras-cv.git

@bhack in this way I was able to use it, but the loss is stuck at 1.8316 and no improving

bhack commented

I suggest to open a ticket on keras-cv as with components already re-implemented in keras-* we suggest to migrate on that library.

TensorFlow Addons is transitioning to a minimal maintenance and release mode. New features will not be added to this repository. For more information, please see our public messaging on this decision:
TensorFlow Addons Wind Down

Please consider sending feature requests / contributions to other repositories in the TF community with a similar charters to TFA:
Keras
Keras-CV
Keras-NLP