<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>Have I written custom code (as opposed to using a stock example script provided in TensorFlow):<br>
<code class="notranslate">IMAGE_SIZE=224 toco \ --input_file=tf_files/retrained_graph.pb \ --output_file=tf_files/optimized_graph.tflite \ --input_format=TENSORFLOW_GRAPHDEF \ --output_format=TFLITE \ --input_shape=1,${IMAGE_SIZE},${IMAGE_SIZE},3 \ --input_array=input \ --output_array=final_result \ --inference_type=FLOAT \ --input_data_type=FLOAT</code></li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04):<br>
Im using windows subsytems for linux</li>
<li>TensorFlow version (use command below):<br>
tensorflow 1.12</li>
<li>Python version:<br>
2.7</li>
</ul>
<p dir="auto"><strong>Describe the current behavior</strong><br>
i want to convert my custom model to tflite as stated in <a href="https://codelabs.developers.google.com/codelabs/tensorflow-for-poets-2-tflite/#2" rel="nofollow">this</a> but it gives a toco error saying toco: error: argument --output_file is required</p>
<p dir="auto"><strong>Other info / logs</strong></p>
<p dir="auto">this was the whole log:<br>
<code class="notranslate">usage: toco [-h] --output_file OUTPUT_FILE (--graph_def_file GRAPH_DEF_FILE | --saved_model_dir SAVED_MODEL_DIR | --keras_model_file KERAS_MODEL_FILE) [--output_format {TFLITE,GRAPHVIZ_DOT}] [--inference_type {FLOAT,QUANTIZED_UINT8}] [--inference_input_type {FLOAT,QUANTIZED_UINT8}] [--input_arrays INPUT_ARRAYS] [--input_shapes INPUT_SHAPES] [--output_arrays OUTPUT_ARRAYS] [--saved_model_tag_set SAVED_MODEL_TAG_SET] [--saved_model_signature_key SAVED_MODEL_SIGNATURE_KEY] [--std_dev_values STD_DEV_VALUES] [--mean_values MEAN_VALUES] [--default_ranges_min DEFAULT_RANGES_MIN] [--default_ranges_max DEFAULT_RANGES_MAX] [--post_training_quantize] [--drop_control_dependency] [--reorder_across_fake_quant] [--change_concat_input_ranges {TRUE,FALSE}] [--allow_custom_ops] [--converter_mode {DEFAULT,TOCO_FLEX,TOCO_FLEX_ALL}] [--dump_graphviz_dir DUMP_GRAPHVIZ_DIR] [--dump_graphviz_video] toco: error: argument --output_file is required</code></p>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: No</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Linux Ubuntu 18.04 virtual machine that is run on legitimate Windows 10 OS</li>
<li><strong>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device</strong>: N/A</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: github.com/googlecodelabs/tensorflow-for-poets-2</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.9.0 (also tested 1.5.0, and 1.8.0)</li>
<li><strong>Python version</strong>: 3.6</li>
<li><strong>Bazel version (if compiling from source)</strong>: 0.15.2</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: N/A</li>
<li><strong>CUDA/cuDNN version</strong>: N/A? the tf_env_collect.sh program didnt pull any information on this</li>
<li><strong>GPU model and memory</strong>:Rx480 with 4gb of ram</li>
<li><strong>Exact command to reproduce</strong>:<br>
/home/(user name)/.local/bin/toco <br>
 — input_file=tf_files/retrained_graph.pb <br>
 — output_file=tf_files/optimized_graph.lite <br>
 — input_format=TENSORFLOW_GRAPHDEF <br>
 — output_format=TFLITE <br>
 — input_shape=1,224,224,3 <br>
 — input_array=input <br>
 — output_array=final_result <br>
 — inference_type=FLOAT <br>
 — input_data_type=FLOAT</li>
</ul>
<p dir="auto">taken from THIS tutorial:<br>
<a href="https://heartbeat.fritz.ai/working-through-a-tensorflow-lite-tutorial-on-windows-10-e27ee0e8b8cc" rel="nofollow">https://heartbeat.fritz.ai/working-through-a-tensorflow-lite-tutorial-on-windows-10-e27ee0e8b8cc</a></p>
<p dir="auto">(I followed the tutorial pretty much word for word, virtual ubuntu machine and everything since TOCO never worked originally on my windows machine.)</p>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">Describe the problem clearly here. Be sure to convey here why it's a bug in TensorFlow or a feature request.git</p>
<p dir="auto">When I executed the command above after following the directions of that tutorial, originally with tensorflow 1.5.0 installed, the command failes saying<br>
"Check failed: parsed_toco_flags.input_format.specified() Missing required flag: input_format<br>
Aborted (core dumped)"<br>
I'm a novice in tensor flow programming but doesn't the command specify input_format?</p>
<p dir="auto">I looked on other github issues with a similar problem and the experts suggested upgrading tensorflow to 1.8.0 which only results in issues like missing module attributes or import errors. Its probably much more likely that I'm doing something wrong rather than there being a bug with tensorflow, but I'm just so confused as to what mistake I made; I need some expert help.</p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem.</p>
<p dir="auto">v. 1.5.0<br>
ubuntu@ubuntu:~$ /home/ubuntu/.local/bin/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<br>
2018-07-20 01:55:55.974573: F tensorflow/contrib/lite/toco/toco_cmdline_flags.cc:165] Check failed: parsed_toco_flags.input_format.specified() Missing required flag: input_format<br>
Aborted (core dumped)</p>
<p dir="auto">v. 1.8.0<br>
ubuntu@ubuntu:~$ /home/ubuntu/.local/bin/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<br>
Traceback (most recent call last):<br>
File "/home/ubuntu/.local/bin/toco", line 7, in <br>
from tensorflow.contrib.lite.toco.python.toco_wrapper import main<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/<strong>init</strong>.py", line 24, in <br>
from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/<strong>init</strong>.py", line 63, in <br>
from tensorflow.python.framework.framework_lib import *  # pylint: disable=redefined-builtin<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/framework_lib.py", line 104, in <br>
from tensorflow.python.framework.importer import import_graph_def<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/importer.py", line 32, in <br>
from tensorflow.python.framework import function<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/framework/function.py", line 36, in <br>
from tensorflow.python.ops import resource_variable_ops<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 35, in <br>
from tensorflow.python.ops import variables<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 40, in <br>
class Variable(checkpointable.CheckpointableBase):<br>
AttributeError: module 'tensorflow.python.training.checkpointable' has no attribute 'CheckpointableBase'</p>
<p dir="auto">v. 1.9.0<br>
ubuntu@ubuntu:~$ /home/ubuntu/.local/bin/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<br>
Traceback (most recent call last):<br>
File "/home/ubuntu/.local/bin/toco", line 7, in <br>
from tensorflow.contrib.lite.python.tflite_convert import main<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/<strong>init</strong>.py", line 22, in <br>
from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/<strong>init</strong>.py", line 81, in <br>
from tensorflow.python import keras<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/<strong>init</strong>.py", line 24, in <br>
from tensorflow.python.keras import activations<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/activations/<strong>init</strong>.py", line 22, in <br>
from tensorflow.python.keras._impl.keras.activations import elu<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/_impl/keras/<strong>init</strong>.py", line 21, in <br>
from tensorflow.python.keras._impl.keras import activations<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/_impl/keras/activations.py", line 23, in <br>
from tensorflow.python.keras._impl.keras import backend as K<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/_impl/keras/backend.py", line 38, in <br>
from tensorflow.python.layers import base as tf_base_layers<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/layers/base.py", line 25, in <br>
from tensorflow.python.keras.engine import base_layer<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/<strong>init</strong>.py", line 21, in <br>
from tensorflow.python.keras.engine.base_layer import InputSpec<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 33, in <br>
from tensorflow.python.keras import backend<br>
File "/home/ubuntu/.local/lib/python3.6/site-packages/tensorflow/python/keras/backend/<strong>init</strong>.py", line 22, in <br>
from tensorflow.python.keras._impl.keras.backend import abs<br>
ImportError: cannot import name 'abs'</p>