擅长:python、mysql、java
<p>我建议<em>不要</em>使用任何<code>tf.image.resize_*</code>函数作为<a href="https://stackoverflow.com/questions/50591669/tf-image-resize-bilinear-vs-cv2-resize/50611485#50611485">they suffer from a nasty bug</a>来<a href="https://github.com/tensorflow/tensorflow/issues/6720#issuecomment-298130034" rel="nofollow noreferrer">not be fixed</a>。</p>
<p>一组新的、不同的图像重采样功能显然正在酝酿之中。同时,您可以在web上找到一些关于如何自己使用<a href="http://warmspringwinds.github.io/tensorflow/tf-slim/2016/11/22/upsampling-and-image-segmentation-with-tensorflow-and-tf-slim/" rel="nofollow noreferrer">transposed convolutions</a>来实现这一点的示例。不幸的是,每通道上采样的效率要低得多,但正确的要比快速的好。</p>
<p><strong>编辑</strong></p>
<p>他们终于在<a href="https://github.com/tensorflow/tensorflow/releases/tag/v2.0.0-alpha0" rel="nofollow noreferrer">TF 2.0</a>中修复了这个错误:</p>
<blockquote>
<ul>
<li><code>image.resize</code> now considers proper pixel centers (...).</li>
</ul>
</blockquote>
<p>此修复当前不通过渐变,这是。。。希望也能得到修复的错误。</p>