
代码bug
北木.
交流分享,共同成长
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
代码没有问题,但扔报错如下:Line 29 in _driver(Solution.py) Line 42 in <module>(Solution.py)
项目场景:在使用leetcode或者剑指offer等刷题时,发现代码没有错误,但仍出现报错如下:python版:java版:解决方案:类名的大小或者格式等写出问题了,修改过来原创 2021-03-26 10:47:06 · 1241 阅读 · 0 评论 -
InvalidArgumentError (see above for traceback): clip_value_min and clip_value_max must be either...
项目场景:强化学习倒立摆实验中,当成功安装完gym模块后,仍然无法运行问题描述: InvalidArgumentError (see above for traceback): clip_value_min and clip_value_max must be either of the same shape as input, or a scalar. input shape: [1,1]clip_value_min shape: [1]clip_value_max shape: [1] [原创 2020-11-18 15:39:16 · 268 阅读 · 0 评论 -
成功解决TypeError: only size-1 arrays can be converted to Python scalars
文章目录问题描述:解决方案:问题描述:base_action = [ 2. -1.65909091 2. -2. 2. 0.22669992 2. -2. -1.62084658 2. -0.40106834 -2. -0.19870362 -1.6288685 -2. 0.02443762 -2. -1.7053572 0.8390264原创 2020-11-12 11:52:35 · 25994 阅读 · 3 评论 -
成功解决代码报错ValueError: setting an array element with a sequence
项目场景:使用DDPG算法进行动作选择时,输入choos_action函数的元组S为(array([ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,18, 19, 20]), 0),当使用[np.newaxis,:]进行维度变化时,出现了维度上元素个数不一致的情况。问题描述:输入的元组无法通过维度变换,转化成矩阵。解决方案:通过对输入的数据进行处理,将其转化成矩阵,然后通过[np.newaxis,:]进行矩原创 2020-11-12 11:23:29 · 4894 阅读 · 2 评论 -
成功解决TypeError: tuple indices must be integers or slices, not tuple
文章目录问题描述:原因分析:解决方案:问题拓展:问题描述:元组的索引必须是整数或者切片,不能是元组原因分析:元组的访问方式出错解决方案:详情查看:Python基础—列表、元组、集合、字典问题拓展:问题格式类似:XXX indices must be integers or slices, not XXX时,一般都是访问方式出现错误...原创 2020-11-12 10:40:02 · 12556 阅读 · 0 评论 -
完美解决IndexError: index 0 is out of bounds for axis 1 with size 0
文章目录问题描述原因分析解决方案问题描述IndexError: index 0 is out of bounds for axis 1 with size 0原因分析 查看列表,输出列表内容,查看列表的形状,发现列表的确是空值,所以修改列表内容即可!print(List.shape)解决方案y = train_np[:, 0]print(train_np) ...原创 2020-10-31 21:48:01 · 24623 阅读 · 1 评论 -
RecursionError: maximum recursion depth exceeded in comparison
这种问题的产生是由于存储超出了python本身设置的范围,可做如下修改:import syssys.setrecursionlimit(100000)原创 2020-09-01 16:14:46 · 311 阅读 · 0 评论 -
Python语法错误:IndentationError: unindent does not match any outer indentation level
原因分析对于此错误,一般不是因为代码问题引起的,而最常见的原因是,换行的时候没有对齐。解决方法对错误所提示的行数进行重新编辑即可。原创 2020-07-10 10:35:44 · 357 阅读 · 0 评论 -
ValueError: Variable eval_net/l1/w1 already exists, disallowed. Did you mean to set reuse=True or...
当在spyder中运行代码时报错如下:ValueError: Variable eval_net/l1/w1 already exists, disallowed. Did you mean to set reuse=True or reuse=tf.AUTO_REUSE in VarScope? Originally defined at: File "D:\Tools software...原创 2019-11-28 11:14:12 · 2403 阅读 · 0 评论 -
VS 程序运行结果框闪退
VS写c/c++程序,运行结果框总是会一闪而退,根本看不到程序运行的结果,现有三种解决方案:1.方法一:在return 0;语句之前, 加上一个 getchar();语句, 如此,getchar会一直等待输入,程序运行结果框也就正常显示运行结果了。2.方法二:再加上头文件 #include<stdlib.h>, 在程序末尾return 语句前加上:system(“pause”...原创 2019-10-26 22:07:53 · 520 阅读 · 0 评论 -
VS 2013/2015 安装配置boost库
1.首先下载相应版本的boost库:http://www.boost.org/http://www.boost.org/users/download/https://dl.bintray.com/boostorg/release/1.68.0/source/ (可以通过修改68查找相应版本)https://dl.bintray.com/boostorg/release/1.66.0/bi...原创 2019-10-24 10:03:04 · 1605 阅读 · 0 评论 -
VS2013使用boost库发生fatal error C1001错误的解决办法
编译器中发生内部错误。出现该编译错误的解决办法是安装升级VS2013的update5。目前很难找到单独的update 5 更新包,msdn上的页面也提示error,只有从https://msdn.itellyou.cn/ 这上面找到 vs2013 with update 5 的镜像重新安装了;根据自己的版本类型选择:企业版(premium)、专业版(Professional)、社区版(ult...原创 2019-10-23 21:52:11 · 537 阅读 · 0 评论 -
error C2899: 不能在模板声明之外使用类型名称
英文的真实描述为:“typename cannot be used outside a template declaration”,由于翻译错误,将 typename 翻译成了 类型名称 解决办法: 根据错误指示的行数, 删除即可 typename除用在模板声明中外,只能用于说明模板类的成员是一个类型.例如:template class X {};// Another wa...原创 2019-10-23 21:38:41 · 5070 阅读 · 0 评论 -
TypeError: int() argument must be a string, a bytes-like object or a number, not 'builtin_function_o
import randomprint(int(random.random))错误如下:解决办法:import randomprint(int(random.random()))结果为: 0import randomprint(random.random())结果为:生成0-1之间的随机数...原创 2019-10-23 10:42:51 · 1794 阅读 · 0 评论