【发布时间】:2020-09-22 21:15:46
【问题描述】:
l_conv7 = self.loc_conv7(conv7_feats) # (N, 24, 19, 19)
l_conv7 = l_conv7.permute(0, 2, 3, 1).contiguous() # (N, 19, 19, 24)
l_conv7 = l_conv7.view(batch_size, -1, 4) # (N, 2166, 4), there are a total 2116 boxes on this feature map
在 TensorFlow 中与 torch 的视图等价的是什么? 如何在 TensorFlow 2.0 中更改 l_conv7.view?
【问题讨论】:
-
您可以使用
tf.reshape()。更具体地说,使用l_conv7 = tf.reshape(l_conv7, new_shape)
标签: tensorflow pytorch tensorflow2.0 torch