<p dir="auto">It appears that only some of the image ops (e.g. <code class="notranslate">tf.image.random_saturation()</code>) only accept single images (rank-3 tensors), while others allow batches of images (rank-4 tensors). Should this be made more consistent so that all image ops allow for higher-rank tensors? There doesn't seem to be much about this in the API documentation (some ops just say that the last dimension needs to be 3).</p>
<h3 dir="auto">System Information</h3>
<ul dir="auto">
<li><em>Have I written custom code?</em>: Yes</li>
<li><em>OS Platform and Distribution</em>: Ubuntu 16</li>
<li><em>TensorFlow installed from (source or binary)?</em>: binary</li>
<li><em>TensorFlow version</em>: 1.0.1</li>
<li><em>Bazel version (if compiling from source)</em>: N/A</li>
<li><em>CUDA/cuDNN version</em>: N/A</li>
<li><em>GPU Model and Memory</em>: N/A</li>
<li><em>Exact command to reproduce</em>:</li>
</ul>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import tensorflow as tf
images = tf.placeholder(tf.float32, shape=(None, None, None, 3), name='images')
# This is OK
x = tf.image.random_contrast(images, lower=0.5, upper=1.0)
# Throws an exception because `images` is rank-4
x = tf.image.random_saturation(images, lower=0.5, upper=1.0)"><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-s1">images</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s1">tf</span>.<span class="pl-s1">float32</span>, <span class="pl-s1">shape</span><span class="pl-c1">=</span>(<span class="pl-c1">None</span>, <span class="pl-c1">None</span>, <span class="pl-c1">None</span>, <span class="pl-c1">3</span>), <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">'images'</span>)
<span class="pl-c"># This is OK</span>
<span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">image</span>.<span class="pl-en">random_contrast</span>(<span class="pl-s1">images</span>, <span class="pl-s1">lower</span><span class="pl-c1">=</span><span class="pl-c1">0.5</span>, <span class="pl-s1">upper</span><span class="pl-c1">=</span><span class="pl-c1">1.0</span>)
<span class="pl-c"># Throws an exception because `images` is rank-4</span>
<span class="pl-s1">x</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">image</span>.<span class="pl-en">random_saturation</span>(<span class="pl-s1">images</span>, <span class="pl-s1">lower</span><span class="pl-c1">=</span><span class="pl-c1">0.5</span>, <span class="pl-s1">upper</span><span class="pl-c1">=</span><span class="pl-c1">1.0</span>)</pre></div>
<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>:</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>
<p dir="auto">bazel run -c opt tensorflow/contrib/lite/toco:toco -- --savedmodel_directory=C:\Users\LENOVO-PC\DIZIZIT\saved_model -- output_file=C:\Users\LENOVO-PC\DIZIZIT\saved_model\maonani.tflite</p>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">Im trying to convert my saved_model.pb from object detection api file to tensorflow lite but it gives me error such as</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: C:/users/lenovo-pc/tensorflow/tensorflow/contrib/lite/kernels/BUILD:63:1: C++ compilation of rule '//tensorflow/contrib/lite/kernels:gemm_support' failed (Exit 2)
.\tensorflow/contrib/lite/context.h(183): error C2144: syntax error: 'float' should be preceded by ';'
.\tensorflow/contrib/lite/context.h(183): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Target //tensorflow/contrib/lite/toco:toco failed to build
"><pre class="notranslate"><code class="notranslate">ERROR: C:/users/lenovo-pc/tensorflow/tensorflow/contrib/lite/kernels/BUILD:63:1: C++ compilation of rule '//tensorflow/contrib/lite/kernels:gemm_support' failed (Exit 2)
.\tensorflow/contrib/lite/context.h(183): error C2144: syntax error: 'float' should be preceded by ';'
.\tensorflow/contrib/lite/context.h(183): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Target //tensorflow/contrib/lite/toco:toco failed to build

</code></pre></div>
<p dir="auto">I tried reinstalling all the pre req of tensorflow and use  the code again and it gave different error saying</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: C:/users/lenovo-pc/tensorflow/tensorflow/contrib/lite/kernels/BUILD:41:1: C++ compilation of rule '//tensorflow/contrib/lite/kernels:eigen_support' failed (Exit 2)
cl : Command line error D8021 : invalid numeric argument '/Wno-error=reorder'
Target //tensorflow/contrib/lite/toco:toco failed to build
"><pre class="notranslate"><code class="notranslate">ERROR: C:/users/lenovo-pc/tensorflow/tensorflow/contrib/lite/kernels/BUILD:41:1: C++ compilation of rule '//tensorflow/contrib/lite/kernels:eigen_support' failed (Exit 2)
cl : Command line error D8021 : invalid numeric argument '/Wno-error=reorder'
Target //tensorflow/contrib/lite/toco:toco failed to build

</code></pre></div>
<p dir="auto">for the 3rd attempt it gives me error saying:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: C:/users/lenovo-pc/tensorflow/tensorflow/contrib/lite/profiling/BUILD:37:1: C++ compilation of rule '//tensorflow/contrib/lite/profiling:time' failed (Exit 2)
tensorflow/contrib/lite/profiling/time.cc(17): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
Target //tensorflow/contrib/lite/toco:toco failed to build
Use --verbose_failures to see the command lines of failed build steps."><pre class="notranslate"><code class="notranslate">ERROR: C:/users/lenovo-pc/tensorflow/tensorflow/contrib/lite/profiling/BUILD:37:1: C++ compilation of rule '//tensorflow/contrib/lite/profiling:time' failed (Exit 2)
tensorflow/contrib/lite/profiling/time.cc(17): fatal error C1083: Cannot open include file: 'sys/time.h': No such file or directory
Target //tensorflow/contrib/lite/toco:toco failed to build
Use --verbose_failures to see the command lines of failed build steps.
</code></pre></div>
<h3 dir="auto">Source code / logs</h3>
<p dir="auto">C:\Users\LENOVO-PC\tensorflow&gt;bazel run -c opt tensorflow/contrib/lite/toco:toco -- --savedmodel_directory=C:\Users\LENOVO-PC\DIZIZIT\saved_model -- output_file=C:\Users\LENOVO-PC\DIZIZIT\saved_model\maonani.tflite<br>
INFO: Build options have changed, discarding analysis cache.<br>
INFO: Analysed target //tensorflow/contrib/lite/toco:toco (1 packages loaded).<br>
INFO: Found 1 target...<br>
ERROR: C:/users/lenovo-pc/tensorflow/tensorflow/contrib/lite/kernels/BUILD:63:1: C++ compilation of rule '//tensorflow/contrib/lite/kernels:gemm_support' failed (Exit 2)<br>
.\tensorflow/contrib/lite/context.h(183): error C2144: syntax error: 'float' should be preceded by ';'<br>
.\tensorflow/contrib/lite/context.h(183): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int<br>
Target //tensorflow/contrib/lite/toco:toco failed to build<br>
Use --verbose_failures to see the command lines of failed build steps.<br>
INFO: Elapsed time: 6.715s, Critical Path: 1.81s<br>
INFO: 1 process: 1 local.<br>
FAILED: Build did NOT complete successfully<br>
FAILED: Build did NOT complete successfully</p>
<p dir="auto">2nd attempt was too long to post here</p>