import numpy as np
import sys
try:
+ from distutils.version import LooseVersion, StrictVersion
import tensorflow as tf
+
+ if (LooseVersion(tf.VERSION) < LooseVersion("1.11.0")): raise (Exception("Wrong Version"))
except:
- print("!! Tensorflow not installed, tflite frontend test not generated", file=sys.stderr)
- exit(999)
+ print("!! Tensorflow v 1.11 not installed, tflite frontend test not generated", file=sys.stderr)
+ exit(1)
resDir = sys.argv[1]
if resDir[-1]!="/": resDir +="/"
# Filter the input image.
with tf.Session() as sess:
out = sess.run(out0, feed_dict = {"input:0": np.ones((1, 28, 28, 1)).astype(np.float32)})
- # print(sess.graph_def)
-
frozen_graphdef = tf.graph_util.convert_variables_to_constants(
sess, sess.graph_def, ["out"])
tflite_model = tf.contrib.lite.TocoConverter(