<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>: none</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: windows 10</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: pip</li>
<li><strong>TensorFlow version (use command below)</strong>: 1.9</li>
<li><strong>Python version</strong>:  3.5.1-32 bit</li>
<li><strong>Bazel version (if compiling from source)</strong>: 0.15.0</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>:</li>
<li><strong>CUDA/cuDNN version</strong>: nothing since i have AMD radeon</li>
<li><strong>GPU model and memory</strong>:</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tflite_convert \
  --output_file=/saved_model/maonani.tflite \
  --saved_model_dir=/saved_model/saved_model"><pre class="notranslate"><code class="notranslate">tflite_convert \
  --output_file=/saved_model/maonani.tflite \
  --saved_model_dir=/saved_model/saved_model
</code></pre></div>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">when i enter the command on cmd i get a response saying:</p>
<p dir="auto"><strong>'tflite_convert'</strong> is not recognized as an internal or external command,<br>
operable program or batch file.</p>
<p dir="auto">i dont know why im getting this since i already have cloned the git repository of tensorflow</p>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">C:\Users\LENOVO-PC\tensorflow&gt; tflite_convert \ --output_file=/saved_model/maonani.tflite \ --saved_model_dir=/saved_model/saved_model<br>
'tflite_convert' is not recognized as an internal or external command,<br>
operable program or batch file.</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>: Windows 10</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>: source, pip install --upgrade tf-nightly</li>
<li><strong>TensorFlow version (use command below)</strong>: GIT: 'v1.9.0-rc2-798-gc818bf016d', VERSION: '1.10.0-dev20180719'</li>
<li><strong>Python version</strong>: 3.6.6</li>
<li><strong>Bazel version (if compiling from source)</strong>:</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>:</li>
<li><strong>CUDA/cuDNN version</strong>:</li>
<li><strong>GPU model and memory</strong>:</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<h3 dir="auto">Python API</h3>
<p dir="auto">`import tensorflow as tf</p>
<p dir="auto">converter = tf.contrib.lite.TocoConverter.from_keras_model_file("model.h5")<br>
tflite_model = converter.convert()<br>
open("model.tflite", "wb").write(tflite_model)`<br>
and</p>
<h3 dir="auto">Command-line</h3>
<p dir="auto"><code class="notranslate">toco</code></p>
<p dir="auto">You can collect some of this information using our environment capture script:</p>
<p dir="auto"><a href="https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh">https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh</a></p>
<p dir="auto">You can obtain the TensorFlow version with</p>
<p dir="auto">python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"</p>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">I'm trying to convert a keras model to the tflite format, but the sample code provided on the website doesn't seem to work. As advised in my <a href="https://github.com/tensorflow/tensorflow/issues/20826" data-hovercard-type="issue" data-hovercard-url="/tensorflow/tensorflow/issues/20826/hovercard">other issue</a>, I installed tf-nightly. I used a venv to get a clean environment but for some reason, other issues have arisen. In the case of the Python API, 'lite' seems to be missing from 'tensorflow.contrib' whereas when I run 'toco' from the command line, it raises a ModuleNotFoundError as shown below. Any help would be greatly appreciated.</p>
<h3 dir="auto">Source code / logs</h3>
<h3 dir="auto">Python API</h3>
<p dir="auto"><code class="notranslate">Traceback (most recent call last): File "sandbox/run.py", line 3, in &lt;module&gt; converter = tf.contrib.lite.TocoConverter.from_keras_model_file("model.h5") File "C:\beta\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 54, in __getattr__ return getattr(module, item) AttributeError: module 'tensorflow.contrib' has no attribute 'lite'</code></p>
<h3 dir="auto">Command-line (running toco)</h3>
<p dir="auto"><code class="notranslate">Traceback (most recent call last): File "c:\users\user\appdata\local\programs\python\python36\Lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\user\appdata\local\programs\python\python36\Lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\beta\Scripts\toco.exe\__main__.py", line 5, in &lt;module&gt; ModuleNotFoundError: No module named 'tensorflow.contrib.lite.python.tflite_convert'</code></p>