擅长:python、mysql、java
<p>正如GBY提到的,它们使用相同的实现。</p>
<p>参数略有不同。</p>
<p>对于tf.nn.conv2d:</p>
<pre><code>filter: A Tensor. Must have the same type as input. A 4-D tensor of shape [filter_height, filter_width, in_channels, out_channels]
</code></pre>
<p>对于tf.layers.conv2d:</p>
<pre><code>filters: Integer, the dimensionality of the output space (i.e. the number of filters in the convolution).
</code></pre>
<p>在加载预先训练的模型(示例代码:<a href="https://github.com/ry/tensorflow-vgg16" rel="noreferrer">https://github.com/ry/tensorflow-vgg16</a>)时,我将使用tf.nn.conv2d,对于从头开始训练的模型,我将使用tf.layers.conv2d。</p>