But still can’t figure this out. Swapping the order of parameters in tf.gather changes when the error occurs. It changes whether the error happens at the first or the 4th iteration of the for loop.
This is a very common error and you can find lots of threads about it by searching for yolo_non_max_suppression. But did you read all the way through the thread you linked above? E.g. here’s a later post on that thread that covers more issues. And even later on that thread, here’s a very comprehensive post from mentor Raymond. Definitely worth a look, but you will need to have your thinking cap firmly affixed and your morning coffee already on board!