Skip to content

Instantly share code, notes, and snippets.

@anoken
Last active September 5, 2019 20:25
Show Gist options
  • Save anoken/d13be16526cd8606ac6390f0412212e0 to your computer and use it in GitHub Desktop.
Save anoken/d13be16526cd8606ac6390f0412212e0 to your computer and use it in GitHub Desktop.
convert_tfline_kmodel_nncase_v0.2.0.sh
#!/bin/bash
echo "Usage: ./convert.sh modelxxx.tflite"
name=`echo $1 | cut -d '.' -f 1`
tflite_out=$name.tflite
kmodel_out=$name.kmodel
#nncase
# https://github.com/kendryte/nncase
# wget https://github.com/kendryte/nncase/releases/download/v0.2.0-alpha1/ncc-linux-x86_64.tar.xz
ncc_exe=~/nncase/ncc
echo ">> Converting TFlite to Kmodel"
$ncc_exe compile $tflite_out ./$kmodel_out -i tflite -o kmodel -t k210 --dataset images
echo ">> OK. Not if all goes well, copy $kmodel_out to scr folder"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment