tuple index out of range
self.X = tf.placeholder(dtype=tf.int32,shape=[None,train_X.shape[1]],name="input_x")
提示出现错误:
tuple index out of range
而我立马判断为train_X数据类型为tuple,然后再去苦苦寻找;在错误的方向上浪费时间;非常不注重在方向判断上努力;
战略上极其懒惰。
x = np.array([1,2])
print(x)
print(x.shape)
print(x.shape[1])IndexError Traceback (most recent call last)
<ipython-input-64-96f6a35db83b> in <module>2 print(x)3 print(x.shape)
----> 4 print(x.shape[1])IndexError: tuple index out of range
如果数据的shape是一维的,那么shape的长度只有1,所以shape[1]就溢出了。
tuple index out of range相关推荐
- 解决tuple index out of range
问题的原因就是前面括号中的索引超处了后面元组中元素的个数 在括号中:前面的数是对后面元组的索引值,因为我的代码中元组只有一个元素,所以当我冒号前的索引值为1时,就会报错
- Python-IndexError: list index out of range
Error:IndexError: list index out of range Where? 对Python中有序序列进行按索引取值的时候,出现这个异常 Why? 对于有序序列: 字符串 str ...
- java out of range_关于Parameter index out of range求解决办法
程序: 提示参数越界,但我实在不知道我到底哪里越界了.明明该我那样写的嘛.求高手帮我看看, 现在我是弄得我有气无力了!要死了.在去死亡的路上等着你帮帮我! Document : replyok C ...
- IndexError: list index out of range的解决办法
IndexError: list index out of range的解决办法 列表的索引也就是他的元素的个数是没有你所想要找的元素位置,比如这个列表只有十个元素你要找第11个元素这个肯定找不到 解 ...
- python list越界原因(list assignment index out of range)
分析: list assignment index out of range:列表超过限制 情况1:list[index]index超出范围 情况2:list是一个空的,没有一个元素,进行list[0 ...
- 爬虫时出现 IndexError: list index out of range 的原因
爬虫时出现 IndexError: list index out of range 的原因有两种: 简单举例如下: 第一种情况: index越界 Alex = [1,2,3] Alex[1] 2 Al ...
- 很有必要看,这篇 解决 IndexError: list index out of range
运行逻辑回归代码,遭遇bug: Traceback (most recent call last):File "D:/DTLFolder/paperTest/Paper_logistic r ...
- mmdetection训练出现:IndexError: list index out of range 错误
mmdetection训练出现:IndexError: list index out of range 错误 文章目录: 1 问题分析 1.1 尝试解决错误:第一次 1.2 尝试解决错误:第二次 2 ...
- 【python基础】list操作相关:扩充、条件查找【IndexError: list assignment index out of range】...
参考 [https://blog.csdn.net/qq_44768814/article/details/88614393] [IndexError: list assignment index o ...
最新文章
- python个人赚钱攻略-每个懂Python的人都必须知道的赚钱神器
- java 重试_Java重试机制修改
- 信号与系统 chapter10 系统的初值问题与系数匹配法
- hdu5692 Snacks dfs序+线段树
- 成功的本质是——做减法
- maven jar包下载
- 分布式任务调度系统xxl-job
- Leetcode Insertion Sort List
- C#基础回顾(一)—C#访问修饰符
- 最新谷歌本地搜索api
- 移动APP开发环境搭建(新手)
- GPRS RTU设备OPC Server接口C# 实现
- 分位数回归--基于R
- yilia头像/图标设置
- android蓝牙hid 鼠标,BLE HID协议-----蓝牙鼠标代码流分析
- 【电子学会】2020年12月图形化一级 -- 海底世界
- 比較好的JAVA網站
- Python制作二维码1
- win10怎么连接android手机,如何将手机与Win10电脑关联以在电脑上继续任务?
- 我的世界服务器物品无法合成,《我的世界》MC玩家无法合成的五大物品,最后一个已经被移除了!...
热门文章
- python基础教程:将一个列表切分成多个小列表
- python教程:关于 [lambda x: x*i for i in range(4)] 理解
- max 安装 mysql5.x_MySQL5.7安装
- mysql怎么计算某个字段重复的个数_2020最新版MySQL数据库面试题(一)
- 小红书去水印代码_小红书关键词排名如何进行优化
- 【AITISA 第11次标准会议新一代人工智能产业技术创新战略联盟——AI标准工作组】神经网络压缩组会议
- windows系统启动时显示cpu over voltage error错误解决办法
- python使用matplotlib画图,绘制三维、二维曲线。设置字体大小以及坐标系间距等
- 计算机应用基础电子毕业考试,计算机应用基础-上海电子信息职业技术学院.PDF...
- centos7.3安装elasticsearch-head