我有一个大小为- 1024,1024,3的数组,并且需要创建这个大小的FIFOQueue。
a = np.zeros((1024, 1024, 3))
dtypes=[tf.float32]
print len(dtypes)
shapes=[1024, 1024, 3]
print len(shapes)
q = tf.FIFOQueue(capacity=200,dtypes=dtypes,shapes=shapes)当我尝试这样做的时候,我得到了这个错误-
ValueError: Shapes (1024, 3) and (1024, 1024, 3) are incompatible发布于 2017-11-15 08:40:53
您发布的代码运行时没有错误。我怀疑有一行遗漏了:
enqueue_op = q.enqueue_many(a)...which在执行时会产生异常:
ValueError: Shapes (1024, 3) and (1024, 1024, 3) are incompatible有两种可能的解决方案:
q.enqueue(a)而不是q.enqueue_many(a)shapes = [1024, 3],它是使用q.enqueue_many(a).时单个元素的形状
https://stackoverflow.com/questions/47297536
复制相似问题