I am following the tutorial as mentioned but getting this error when trying to convert the .pb file
Input:
toco --input_file=tf_files/retrained_graph.pb --output_file=tf_files/optimized_graph.lite --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE --input_shape=1,224,224,3 --input_array=input --output_array=final_result --inference_type=FLOAT --input_data_type=FLOAT
output:
Traceback (most recent call last):
File "/home/dhairy/.local/bin/toco", line 7, in
from tensorflow.contrib.lite.toco.python.toco_wrapper import main
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/init.py", line 24, in
from tensorflow.python import # pylint: disable=redefined-builtin
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/init.py", line 63, in
from tensorflow.python.framework.framework_lib import # pylint: disable=redefined-builtin
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/framework/framework_lib.py", line 102, in
from tensorflow.python.framework.importer import import_graph_def
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 32, in
from tensorflow.python.framework import function
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/framework/function.py", line 37, in
from tensorflow.python.ops import resource_variable_ops
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 35, in
from tensorflow.python.ops import variables
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 40, in
class Variable(checkpointable.CheckpointableBase):
AttributeError: 'module' object has no attribute 'CheckpointableBase'
Finally solved it. I guess it was because toco was not configured properly. If you too face this issue try removing tensorflow completely and then again install it to the latest version available then.
I am following the tutorial as mentioned but getting this error when trying to convert the .pb file Input: toco --input_file=tf_files/retrained_graph.pb --output_file=tf_files/optimized_graph.lite --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE --input_shape=1,224,224,3 --input_array=input --output_array=final_result --inference_type=FLOAT --input_data_type=FLOAT
output: Traceback (most recent call last): File "/home/dhairy/.local/bin/toco", line 7, in
from tensorflow.contrib.lite.toco.python.toco_wrapper import main
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/init.py", line 24, in
from tensorflow.python import # pylint: disable=redefined-builtin
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/init.py", line 63, in
from tensorflow.python.framework.framework_lib import # pylint: disable=redefined-builtin
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/framework/framework_lib.py", line 102, in
from tensorflow.python.framework.importer import import_graph_def
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 32, in
from tensorflow.python.framework import function
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/framework/function.py", line 37, in
from tensorflow.python.ops import resource_variable_ops
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 35, in
from tensorflow.python.ops import variables
File "/home/dhairy/.local/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 40, in
class Variable(checkpointable.CheckpointableBase):
AttributeError: 'module' object has no attribute 'CheckpointableBase'
Anyone with the solution?