has invalid type <class 'numpy.ndarray'>, must be a string or Tensor

转自: https://blog.csdn.net/jacke121/article/details/78833922

has invalid type <class 'numpy.ndarray'>, must be a string or Tensor. (Can not convert a ndarray into a Tensor or Operation.)

 

原因:变量命名重复了

image_test, label_test = get_batch(x_val, y_val, w, h, batch_size, CAPACITY)
img_test, label_test = sess.run([image_test, label_test])

解决方法:把任意一个变量名改了就好了

posted @ 2018-08-21 11:15  chease  阅读(4582)  评论(0编辑  收藏  举报