擅长:python、mysql、java
<p>可以使用<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.transpose.html" rel="nofollow noreferrer">np.transpose</a>来排列数组的维度:</p>
<pre><code>reshaped_dataset = dataset.transpose(0, 2, 3, 1)
</code></pre>
<p>如果<code>dataset</code>的轴代表<code>(n, channel, width, height)</code>,那么<code>reshaped_dataset</code>的轴代表<code>(n, width, height, channel)</code>。你知道吗</p>