TF Keras Applications EfficientNetB0¶
TensorFlow support
The TensorFlow path of the RBLN Compiler is verified with TensorFlow 2.18 and tf_keras 2.18 (the Keras 2 API) on Python 3.10 to 3.12. Keras 3 models are not supported, and later TensorFlow releases are not verified.
Overview¶
This tutorial shows how to compile and run inference with the TF Keras Applications EfficientNetB0 model for image classification using the RBLN Python API.
Setup & Installation¶
Before you begin, ensure that your system environment is properly configured and that all required packages are installed. This includes:
- System Requirements:
- Python: 3.10–3.14
- A system equipped with an RBLN NPU
- RBLN Driver
- Package Requirements:
- Installation Command:
Info
rebel-compilerrequires an RBLN Portal account.- The commands above are intended for a default pip install on Debian-based Linux such as Ubuntu. For all other configurations, refer to the Installation Guide for the supported install matrix and the applicable commands.
Using RBLN Python API¶
Model Compilation¶
Import EfficientNetB0 from the TF Keras Applications module, instantiate the model with pre-trained weights, and convert it into a tf.function.
Model Inference¶
Download and preprocess the input image required for EfficientNetB0. Use preprocess_input() for proper preprocessing. Load the compiled model using RBLN Runtime and run inference on the preprocessed input. Decode the output predictions using decode_predictions() and display the top prediction.
Example Output: