0
A
回答
0
tf.nn.conv2d_transpose
可以做这种上采样(仔细设计output_shape
和strides
)。示例代码:
import tensorflow as tf
import numpy as np
input = tf.convert_to_tensor(np.ones((1, 20, 20, 1)))
input = tf.cast(input, tf.float32)
b = np.zeros((3, 3, 1, 1))
b[1, 1, 0, 0] = 1
weight = tf.convert_to_tensor(b)
weight = tf.cast(weight, tf.float32)
output = tf.nn.conv2d_transpose(input, weight, output_shape=(1, 40, 40, 1), strides=[1, 2, 2, 1])
sess = tf.Session()
print sess.run(output[0, :, :, 0])
我相信检查它的api会帮助你更多。
相关问题
- 1. tensorflow中的numpy.linalg.pinv的替代
- 2. Python的Tensorflow运行在GPU代替CPU
- 3. 用1s代替零的Tensorflow填充
- 4. 在tensorflow中numpy.newaxis的替代方法是什么?
- 5. tensorflow softmax_cross_entropy代码
- 6. 迭代通过tensorflow
- 7. Tensorflow basic_rnn_seq2seq TypeError:预期的int32,得到类型'浮动'-0.1代替
- 8. Tensorflow版本0.12中的tf.Variable.ref()的替代方法是什么?
- 9. bazel在Tensorflow源代码树之外构建tensorflow应用程序
- 10. main =粘贴(替代(...),替代(...))在R_hist_title
- 11. 在TensorFlow中可以用默认的softmax替代默认的softmax吗?
- 12. 替代在Python
- 13. 替代在Java
- 14. 替代在Sybase
- 15. 替代在Windows
- 16. 替代在Python
- 17. 替代在Oracle
- 18. 替代在PHP
- 19. 替代在.NET
- 20. 替代在F#
- 21. 替代在MySQL
- 22. MYSQL在替代
- 23. 替代()在S4
- 24. 替代在C++
- 25. 在替代
- 26. 替代在IE
- 27. 代表时间序列输入/在tensorflow
- 28. Tensorflow:如何替换或修改渐变?
- 29. TensorFlow GPU时代优化?
- 30. Tensorflow CIFAR10代码分析