【发布时间】:2016-10-17 14:31:17
【问题描述】:
我想使用 tensorflow 解决这个问题,但我在网上搜索并发现 git issue#206 指出从 numpy 数组初始化的张量变量仍然不支持索引和切片。
否则我会这样做......
image = mpimg.imread(filename)
height, width, depth = image.shape
x = tf.Variable(image, name='x')
model = tf.initialize_all_variables()
with tf.Session() as session:
session.run(model)
result = session.run(x[::1,:width*0.5,::1]) #this step is not possible
我该用什么??
【问题讨论】:
-
您是想在 Tensorflow 图中创建一个节点来生成镜像,还是只想将结果保存在一个 numpy 数组中? (例如绘制它)
-
一个节点会很棒
标签: python numpy indexing tensorflow