The scripts here use TensorFlow's tools, so you need an environment to run TensorFlow. Running the scripts within this tutorial requires:
- Install TensorFlow v1.12 or later
- Use pip
$ pip install tensorflow==1.12
This tool generaes the following files:
- Tensorflow model files in *.pb, *.pbtxt
- Tensorflow model after freezing in *.pb, *.pbtxt
- Tensorboard log file to visually see the above 1 and 2.
- TFLITE file after running TOCO
By define Test Cases
, you can easily and quickly generate files for various ranks of operands.
-
Copy
MUL_gen.py
orTOPK_gen.py
and modify for your taste.- Note that
TOPK_gen.py
fails while generating TFLITE file since TOCO does not supportTOPK
oeration.
- Note that
-
Run
~/nnfw$ PYTHONPATH=$PYTHONPATH:./tools/tensorflow_model_freezer/ python tools/tensorflow_model_freezer/sample/MUL_gen.py ~/temp
- Files will be generated under
~/temp
- Files will be generated under
$ chmod +x tools/tensorflow_model_freezer/sample/name_of_this_file.py
$ PYTHONPATH=$PYTHONPATH:./tools/tensorflow_model_freezer/ \
tools/tensorflow_model_freezer/sample/name_of_this_file.py \
~/temp # directory where model files are saved
- This tool is tested with Python 2.7 and 3