When I want to convert pb file to tflite OR when I just want to load pb file, I get this error for both cases.
PS: pb file generated from pth (onnx) file.
`import tensorflow as tf
converter = tf.lite.TFLiteConverter.from_frozen_graph('saved_model.pb',
input_arrays=['Pad'], # input arrays
output_arrays=['RELU'] # output arrays as told in upper in my model case it si add_10
)
`
or
`import sys
from tensorflow.python.platform import gfile
from tensorflow.core.protobuf import saved_model_pb2
from tensorflow.python.util import compat
import tensorflow as tf
from tensorflow.python.platform import gfile
with tf.Session() as sess:
model_filename ='saved_model.pb'
with gfile.FastGFile(model_filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
When I want to convert pb file to tflite OR when I just want to load pb file, I get this error for both cases. PS: pb file generated from pth (onnx) file.
`import tensorflow as tf converter = tf.lite.TFLiteConverter.from_frozen_graph('saved_model.pb', input_arrays=['Pad'], # input arrays output_arrays=['RELU'] # output arrays as told in upper in my model case it si add_10 )
`
or
`import sys from tensorflow.python.platform import gfile
from tensorflow.core.protobuf import saved_model_pb2 from tensorflow.python.util import compat
import tensorflow as tf from tensorflow.python.platform import gfile with tf.Session() as sess: model_filename ='saved_model.pb' with gfile.FastGFile(model_filename, 'rb') as f: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read())
print(graph_def)