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])
解决方法:把任意一个变量名改了就好了
has invalid type <class 'numpy.ndarray'>, must be a string or Tensor的更多相关文章
- TypeError: Fetch argument 0.484375 has invalid type <class 'numpy.float32'>, must be a string or Tensor. (Can not convert a float32 into a Tensor or Operation.)
报错: TypeError: Fetch argument 0.484375 has invalid type <class 'numpy.float32'>, must be a str ...
- 解决Tensorflow ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type numpy.ndarray)
问题描述 在将一个数组送入tensorflow训练时,报错如下: ValueError: Failed to convert a NumPy array to a Tensor (Unsupporte ...
- Python中Numpy ndarray的使用
本文主讲Python中Numpy数组的类型.全0全1数组的生成.随机数组.数组操作.矩阵的简单运算.矩阵的数学运算. 尽管可以用python中list嵌套来模拟矩阵,但使用Numpy库更方便. 定义数 ...
- torch.Tensor和numpy.ndarray
1. torch.Tensor和numpy.ndarray相互转换 import torch import numpy as np # <class 'numpy.ndarray'> np ...
- python:<class 'numpy.ndarray'>的学习
在学习opencv-python的时候,给出图片地址再调用cv2.imread("地址"),发现出创建的是numpy类型的ndarray对象,用来存放多维数组的对象 # 导入cv2 ...
- Lesson2——NumPy Ndarray 对象
NumPy 教程目录 NumPy Ndarray 对象 NumPy 最重要的一个特点是其 $N$ 维数组对象 ndarray,它是一系列同类型数据的集合,以 $0$ 下标为开始进行集合中元素的索引. ...
- java.io.StreamCorruptedException: invalid type code: AC错误的解决方法
问题描述: 在向一个文件写入可序列化对象时,每次只想向文件的末尾添加一个可序列化的对象,于是使用了FileOutputStream(文件名,true)间接的构建了ObjectOutputStream流 ...
- TypeError: Fetch argument 0 has invalid type <type 'int'>, must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)
6月5日的時候,修改dilated_seg.py(使用tensorflow)出現了報錯: TypeError: Fetch argument 0 has invalid type <type ' ...
- python中numpy.ndarray.shape的用法
今天用到了shape,就顺便学习一下,这个shape的作用就是要把矩阵进行行列转换,请看下面的几个例子就明白了: >>> import numpy as np >>> ...
随机推荐
- 重置 Mac 上的 NVRAM 或 PRAM
https://support.apple.com/zh-cn/HT204063 如果 Mac 出现了与 NVRAM 或 PRAM 中储存的设置有关的问题,那么进行重置可能会有帮助. NVRAM( ...
- object detection[YOLO]
这部分,我们来聊聊YOLO. YOLO:You Only Look Once,顾名思义,就是希望网络在训练过程中,一张图片只要看一次就行,不需要去多次观察,比如滑框啥的,从而从底层原理上就减少了很多的 ...
- mongodb java3.2驱动 测试 一些记录
mongo驱动包 自带线程池的概念 获取 MongoClient mongoClient 后 通过客户端(mongoClient ) 获取 库操作 MongoDatabase 获取 表操作 Mongo ...
- Mac 小记 — iTerm2、Zsh、Homebrew
前言 写完 "Ubuntu 自动化配置" 这篇文章后,每次连服务器心情指数都上升好几个百分点,于是想着应该将 macOs 的开发环境也梳理梳理,应该会对开发效率有所增益. 1. i ...
- Python异常处理try except
原文地址:https://www.cnblogs.com/init-life/p/9105546.html 异常处理try except 在Python中,异常处理,主要是try except语句,通 ...
- Python_匿名函数_47
匿名函数 Eva_J 匿名函数:为了解决那些功能很简单的需求而设计的一句话函数 #这段代码 def calc(n): return n**n print(calc(10)) #换成匿名函数 calc ...
- Python_%---format_43
fat39 博客园 首页 新随笔 联系 订阅 管理 随笔 - 142 文章 - 0 评论 - 0 python基础_格式化输出(%用法和format用法) 目录 %用法 format用法 %用 ...
- python3 pip 安装Scrapy在win10 安装报错error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
问题描述 当前环境win10,python_3.6.1,64位. 在windows下,在dos中运行pip install Scrapy报错: building 'twisted.test.raise ...
- H5 14-后代选择器和子元素选择器
14-后代选择器和子元素选择器 <!DOCTYPE html> <html lang="en"> <head> <meta charset ...
- CF892.B. Wrath
---恢复内容开始--- 题意: 有n个犯人,手上都有个长度为Li的武器,当铃响时大家同时挥动武器,只能把前面攻击范围内的敌人杀死,问最后还剩几个人. 题目传送门: [http://codeforce ...