YoloV3 in TF 2.0: a clean port with the migration notes included
It ports YoloV3 to TensorFlow 2.0’s eager execution and Keras functional API, then documents exactly where the framework bites back.

What it does
This is a ground-up re-implementation of the YoloV3 object-detection network for TensorFlow 2.0, packaging both the full model and the lightweight yolov3-tiny variant with pre-trained Darknet weights. It covers the whole lifecycle: inference on images and video, transfer learning, eager training with tf.GradientTape, graph-mode training via model.fit, and export to TensorFlow Serving. The author emphasizes “clean” code and best practices, using tf.keras.layers, tf.data pipelines, and absl-py for flags.
The interesting bit
The README’s value isn’t just the code; it’s the candid implementation notes. The author openly discusses the pain points of loading Darknet weights into Keras’s functional API because of layer ordering mismatches, the re-compilation traps of @tf.function, and why model(x) can be slower than model.predict if you ignore graph compilation overhead. It even includes a “simple hack” for BatchNormalization during transfer learning, which is the kind of detail usually buried in GitHub issues.
Key highlights
- Supports both
yolov3andyolov3-tinywith converted pre-trained weights. - Offers three training modes: eager
GradientTape, graphmodel.fit, and a hybrideager_fit. - Includes a full TF 2.0 data pipeline using
tf.dataand vectorized transformations. - Exports to TensorFlow Serving with a documented signature for bounding boxes, scores, and classes.
- Provides rough latency benchmarks across CPU, desktop GPU, and AWS Tesla instances.
Caveats
- The benchmark numbers are explicitly labeled as “rough calculations” from
detect_video.py, not rigorous training or inference benchmarks. - Training can fail with NaN loss if input bounding-box coordinates are not normalized or if the learning rate is too high; the README warns that label formats vary between tools like VOTT and labelImg.
- Keras’s h5 format cannot save the nested sub-models used for Darknet weight loading, so you must use TF Checkpoints instead.
Verdict
Worth a look if you need a readable, well-commented YoloV3 baseline in modern TensorFlow and want to avoid the usual TF 2.0 migration pitfalls. Skip it if you are married to PyTorch or need a turn-key, production-hardened object-detection framework with enterprise support.
Frequently asked
- What is zzh8829/yolov3-tf2?
- It ports YoloV3 to TensorFlow 2.0’s eager execution and Keras functional API, then documents exactly where the framework bites back.
- Is yolov3-tf2 open source?
- Yes — zzh8829/yolov3-tf2 is open source, released under the MIT license.
- What language is yolov3-tf2 written in?
- zzh8829/yolov3-tf2 is primarily written in Jupyter Notebook.
- How popular is yolov3-tf2?
- zzh8829/yolov3-tf2 has 2.5k stars on GitHub.
- Where can I find yolov3-tf2?
- zzh8829/yolov3-tf2 is on GitHub at https://github.com/zzh8829/yolov3-tf2.