0

I've been trying to get the Yolo v3 to work in TF 2.x for the last few weeks, and every time I fix one problem, another one shows up. The main challenge was with actually making TensorFlow do the NonMaxSuppression for each scale, and sample in the training set. I used tf.image.non_max_suppression_padded, and I was hit by

Tensorflow.python.framework.errors_impl.OperatorNotAllowedInGraphError: using a `tf.Tensor` as a Python `bool` is not allowed in Graph execution. Use Eager execution or decorate this function with @tf.function.

I fixed this by disabling the eager execution, and moved till Model(input, output), but this time I am hit by

tensorflow.python.framework.errors_impl.InternalError: Tensorflow type 21 not convertible to numpy dtype

I tried stacking the TensorArray (yes, TensorArray because I had to loop over each scale and sample in the batch), converting to Tensor, but nothing worked.

Tips on how I can fix this?

VM_AI
  • 1,132
  • 4
  • 13
  • 25
  • You might want to have a look in following repo which has the implementation of YOLOv3 with TF 2.x: https://github.com/zzh8829/yolov3-tf2 – Hamid Shatu Jul 03 '20 at 03:14

1 Answers1

1

If you just want a yolo working with tensorflow 2.X, you may want to try this version: https://github.com/hunglc007/tensorflow-yolov4-tflite

The implementation is complete, with scrcipt to convert the model to tflite and tftrt, but you can run it as is.

Thlang
  • 161
  • 1
  • 4
  • No, it would be my intention to go past all the conceptual challenges to experiment with the model of variable sizes, but never thought a framework would pose such problems. I wish to alter the architecture and try training with data of specific domain. – VM_AI Jul 02 '20 at 13:45