I don't understand why the code wouldn't run on TF2.4, but I found the reason causing the failure. Taking detection_demo.py as an example, detect_video, detect_realtime and detect_screen all fail, but one just needs to make a tiny change in utils.py:
if YOLO_FRAMEWORK == "tf":
pred_bbox = yolo.predict(image_data)
by changing yolo.predict->yolo, then it works like a charm again.
I looked up online, it seems there is no difference between model.predict() and model(), but anyhow it fails the code in TF2.4.
Happy learning,
Cheers
I don't understand why the code wouldn't run on TF2.4, but I found the reason causing the failure. Taking
detection_demo.pyas an example,detect_video,detect_realtimeanddetect_screenall fail, but one just needs to make a tiny change inutils.py:by changing
yolo.predict->yolo, then it works like a charm again.I looked up online, it seems there is no difference between
model.predict()andmodel(), but anyhow it fails the code in TF2.4.Happy learning,
Cheers