<p dir="auto">Hi,<br>
I'm wondering which steps are necessary to move from the greedy decoder currently implemented to an actual beam search decoder. Is this enhancement already in someone's roadmap? If not, could anyone tell me which is the right point in the code where to add this functionality?<br>
Thanks a lot!<br>
Marcello</p>
<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): No</li>
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): 16.04</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Yes</li>
<li>TensorFlow installed from (source or binary): binary</li>
<li>TensorFlow version (use command below): 1.13.0-dev20181222</li>
<li>Python version: 3.6</li>
<li>Bazel version (if compiling from source): /</li>
<li>GCC/Compiler version (if compiling from source): /</li>
<li>CUDA/cuDNN version: 9.1</li>
<li>GPU model and memory: 1080 Ti with 11Gib memory</li>
</ul>
<p dir="auto">You can collect some of this information using our environment capture <a href="https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh">script</a><br>
You can also obtain the TensorFlow version with<br>
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"</p>
<p dir="auto"><strong>Code to reproduce the issue</strong><br>
I was trying to convert the model in <a href="https://github.com/MIT-HAN-LAB/ProxylessNAS">https://github.com/MIT-HAN-LAB/ProxylessNAS</a> to TFLite, however, when following the tutorial, I got errors below</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf
from proxyless_nas_tensorflow import proxyless_cpu, proxyless_gpu, proxyless_mobile, proxyless_mobile_14

net = proxyless_cpu()
net.is_training = False

converter = tf.lite.TFLiteConverter.from_session(net.sess, [net.images, net.labels], [net.cross_entropy])
tflite_model = converter.convert()
'''
~/anaconda3/envs/tf-nightly/lib/python3.6/site-packages/tensorflow/lite/python/convert.py in toco_convert_protos(model_flags_str, toco_flags_str, input_data_str)
    206       stderr = _try_convert_to_unicode(stderr)
    207       raise ConverterError(
--&gt; 208           &quot;TOCO failed. See console for info.\n%s\n%s\n&quot; % (stdout, stderr))
    209   finally:
    210     # Must manually cleanup files.

ConverterError: TOCO failed. See console for info.
2018-12-22 13:38:13.626047: F tensorflow/core/framework/function.cc:1626] Check failed: GetOpGradFactory()-&gt;insert({op, func}).second Duplicated gradient for ReadVariableOp
Aborted (core dumped)
'''"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span>
<span class="pl-k">from</span> <span class="pl-s1">proxyless_nas_tensorflow</span> <span class="pl-k">import</span> <span class="pl-s1">proxyless_cpu</span>, <span class="pl-s1">proxyless_gpu</span>, <span class="pl-s1">proxyless_mobile</span>, <span class="pl-s1">proxyless_mobile_14</span>

<span class="pl-s1">net</span> <span class="pl-c1">=</span> <span class="pl-en">proxyless_cpu</span>()
<span class="pl-s1">net</span>.<span class="pl-s1">is_training</span> <span class="pl-c1">=</span> <span class="pl-c1">False</span>

<span class="pl-s1">converter</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">lite</span>.<span class="pl-v">TFLiteConverter</span>.<span class="pl-en">from_session</span>(<span class="pl-s1">net</span>.<span class="pl-s1">sess</span>, [<span class="pl-s1">net</span>.<span class="pl-s1">images</span>, <span class="pl-s1">net</span>.<span class="pl-s1">labels</span>], [<span class="pl-s1">net</span>.<span class="pl-s1">cross_entropy</span>])
<span class="pl-s1">tflite_model</span> <span class="pl-c1">=</span> <span class="pl-s1">converter</span>.<span class="pl-en">convert</span>()
<span class="pl-s">'''</span>
<span class="pl-s">~/anaconda3/envs/tf-nightly/lib/python3.6/site-packages/tensorflow/lite/python/convert.py in toco_convert_protos(model_flags_str, toco_flags_str, input_data_str)</span>
<span class="pl-s">    206       stderr = _try_convert_to_unicode(stderr)</span>
<span class="pl-s">    207       raise ConverterError(</span>
<span class="pl-s">--&gt; 208           "TOCO failed. See console for info.<span class="pl-cce">\n</span>%s<span class="pl-cce">\n</span>%s<span class="pl-cce">\n</span>" % (stdout, stderr))</span>
<span class="pl-s">    209   finally:</span>
<span class="pl-s">    210     # Must manually cleanup files.</span>
<span class="pl-s"></span>
<span class="pl-s">ConverterError: TOCO failed. See console for info.</span>
<span class="pl-s">2018-12-22 13:38:13.626047: F tensorflow/core/framework/function.cc:1626] Check failed: GetOpGradFactory()-&gt;insert({op, func}).second Duplicated gradient for ReadVariableOp</span>
<span class="pl-s">Aborted (core dumped)</span>
<span class="pl-s">'''</span></pre></div>
<p dir="auto">Any advice would be appreciated!</p>