Git Product home page Git Product logo

keras_rk3399pro's Introduction

Run Keras/Tensorflow model on RK3399Pro

Clone or download this repo

git clone https://github.com/Tony607/Keras_RK3399pro

Download pre-compiled Python wheel files from my aarch64_python_packages repo and rknn_toolkit wheels from their official GitHub.

Step1: Freeze Keras model and convert to RKNN model (On Linux development machine)

Require Python 3.5+.

Install required libraries for your development machine

pip3 install -r requirements.txt

The install rknn toolkit with the following command.

pip3 install rknn_toolkit-0.9.9-cp36-cp36m-linux_x86_64.whl

To freeze a Keras InceptionV3 ImageNet model to a single .pb file. The frozen graph will accept inputs with shape (N, 299, 299, 3).

freeze_graph.py

To convert the .pb file to .rknn file, run

python3 convert_rknn.py

Step2: Make prediction (On RK3399Pro board)

Setup for the first time.

sudo dnf update -y
sudo dnf install -y cmake gcc gcc-c++ protobuf-devel protobuf-compiler lapack-devel
sudo dnf install -y python3-devel python3-opencv python3-numpy-f2py python3-h5py python3-lmdb
sudo dnf install -y python3-grpcio

sudo pip3 install scipy-1.2.0-cp36-cp36m-linux_aarch64.whl
sudo pip3 install onnx-1.4.1-cp36-cp36m-linux_aarch64.whl
sudo pip3 install tensorflow-1.10.1-cp36-cp36m-linux_aarch64.whl
sudo pip3 install rknn_toolkit-0.9.9-cp36-cp36m-linux_aarch64.whl

To run inference benchmark on RK3399Pro board, in its terminal run,

python3 benchmark_incption_v3.py

keras_rk3399pro's People

Contributors

tony607 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

keras_rk3399pro's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.