![](https://img-blog.csdnimg.cn/20190927151026427.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
编程报错解决
一些在编程遇到的报错问题,并梳理总结解决方案,以便查找和回顾
Sy橙紫
心存希冀,目有繁星,追光而遇,沐光而行
展开
-
IDEA 报错 找不到或无法加载主类
解决IDEA程序运行问题转载 2022-10-11 16:31:22 · 486 阅读 · 0 评论 -
WARNING: There was an error checking the latest version of pip.
解决pip安装模块失败的问题转载 2022-10-11 16:25:42 · 17711 阅读 · 5 评论 -
No module named ‘cv2‘ 的解决办法
在命令窗口输入以下语句运行,成功解决pip install opencv-python原创 2022-05-16 20:11:21 · 215 阅读 · 0 评论 -
No module named ‘tensorflow.contrib‘
报错原因:在TensorFlow2.x版本已经不能使用contrib包解决方案:pip install --upgrade tf_slim将 import tensorflow.contrib.slim as slim改为 import tf_slim as slim参考文章:https://www.codeleading.com/article/38245177754/转载 2021-12-15 20:53:48 · 282 阅读 · 0 评论 -
unindent does not match any outer indentation level解决办法
原因是:代码对齐中,混用TAB和空格,这一点在最新的python语法中不支持pycharm中:采用快捷键 CTRL+ALT+L格式化代码Notepad++:设置-》首先项-》语言-》勾选“替换为空格”参考文章https://www.cnblogs.com/kerrycode/p/11183963.html...翻译 2021-12-07 17:07:05 · 225 阅读 · 0 评论 -
AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘
新的Tensorflow 2.0版本中已经移除了Session这一模块,改换运行代码:sess = tf.InteractiveSession()换成:sess = tf.compat.v1.InteractiveSession()参考:文章转载 2021-12-03 22:16:42 · 237 阅读 · 0 评论 -
module ‘tensorflow‘ has no attribute ‘GPUOptions‘
tf.compat.v1.GPUOptions(per_process_gpu_memory_fraction)参考https://blog.csdn.net/Joyyang_c/article/details/104989447转载 2021-12-03 22:14:55 · 1183 阅读 · 0 评论 -
AttributeError: module ‘tensorflow‘ has no attribute ‘ConfigProto‘
使用CUDA10.1加上Tensorflow 2.0会出现AttributeError: module ‘tensorflow’ has no attribute 'ConfigProto’这个问题,这个是由于现在新版本中一些1.0版本的函数被和2.0版本函数区分开的缘故需要将tf.ConfigProto修改为tf.compat.v1.ConfigProto参考https://blog.csdn.net/u012388993/article/details/102573008/...转载 2021-12-03 22:12:59 · 519 阅读 · 0 评论 -
No module named ‘tensorflow.examples‘
进入github主页下载zip:https://github.com/tensorflow/tensorflow下载完成后将\tensorflow-master\tensorflow\目录下的examples文件夹复制到本地tensorflow文件夹中。重新运行代码即可。参考文章:https://www.cnblogs.com/cat-meow/p/13677386.html...转载 2021-12-03 22:10:59 · 1600 阅读 · 0 评论 -
tf.placeholder() is not compatible with eager execution
解决方式:在文首添加tf.compat.v1.disable_eager_execution()参考:文章转载 2021-12-03 22:04:45 · 186 阅读 · 0 评论 -
AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
查看tf版本,是因为在tf2下使用了tf1的API。解决方式:使用import tensorflow.compat.v1 as tftf.disable_v2_behavior()替换import tensorflow as tf参考文章转载 2021-12-03 22:02:02 · 170 阅读 · 0 评论 -
报错:Figures now render in the Plots pane by default. To make them also appear inline in the Console……
参考文章总结:数据图形可视化出现的图像不显示问题,需要进行设置打开tools→preferences→ipython console→graphics backend→automatic转载 2021-10-22 15:37:21 · 1879 阅读 · 1 评论 -
AssertionError: Torch not compiled with CUDA enabled
运行时报出AssertionError: Torch not compiled with CUDA enabled错误,具体解决方案如下:总结:此错误是由于下载的torch没有cuda,在运行时就会出错,经过查阅,在程序最开始的地方加上:(注意英文下输入,相关运行文件程序开始前都要加上,否则会报错:name ‘device’ is not defined)device = torch.device(“cuda” if torch.cuda.is_available() else “cpu”)代码转载 2021-09-26 21:33:31 · 13603 阅读 · 2 评论 -
MySql报错:unknown mysql server host ‘localhost‘ (0)
在开启mysql如果遇到这个问题,原因就在于数据库连接属性为localhost,在这种情况下,需要连网才能进行连接,否则就会报题目中的错误,如下图:解决办法:右击数据库项,选择连接属性,将主机名或IP地址改为127.0.0.1,下次连接不连网也OK。操作步骤示意图如下:...原创 2021-04-20 15:00:50 · 13023 阅读 · 2 评论 -
Tomcat 端口号被占用的解决方法:Port 8009 required by Tomcat v9.0 Server at localhost is already in use.
解决方法:结束掉端口号被占用的进程首先,按Windows+R键,输入cmd,打开dos命令窗口第二部输入netstat -ano|findstr 8009查看占用端口号的进程号,本机是6404,再输入命令taskkill /pid 6404 /f(注意有空格)问题解决!如下图所示:...原创 2021-03-11 17:01:56 · 731 阅读 · 0 评论 -
新导入maven项目出现红色感叹号的解决办法
导出的maven项目如果有感叹号,那么选中项目选中maven->update project选中force update of Snapshots/releases,这样的话没引入的包就会被重新下载。红色感叹号消失。...原创 2019-09-27 19:20:53 · 626 阅读 · 1 评论 -
连接Mysql显示找不到表
Exception in thread "main" java.lang.RuntimeException: SQL执行错误???at com.yc.dao.DBHelper.selectList(DBHelper.java:187)at com.yc.Biz.ResfoodBizImpl.findAll(ResfoodBizImpl.java:15)at com.yc.Biz.Resfoo...原创 2019-09-07 21:49:58 · 1101 阅读 · 0 评论 -
Mysql服务启动报1067错误
在数据库管理工具中,原本用的没问题的mysql突然连接失败,查看了一下服务和应用程序,发现mysql服务停止了,一旦启动就报错。如下图:通过事件查看器查看了mysql的报错信息,发现是数据库存在错误数据。此时只要删除mysql安装目录下的下面三个文件,重新启动mysql生成即可。亲测有效哦!...转载 2019-09-07 21:40:00 · 352 阅读 · 0 评论 -
eclipse中创建jsp页面报错
eclipse中创建jsp页面报错,怎么办呢在Eclipse中新建jsp的话,很可能会出现报错。下面,我们来看看eclipse中新建jsp页面出错怎么解决吧操作步骤1、找到新建页面所在的工程名字,然后左键选中,右键弹出功能菜单,选择BuildPath,进入配置路径。2、在java build path 页面的下选择Libraries栏目(默认选择),点击右侧的AddLibrary 按钮...转载 2019-07-11 19:48:59 · 3727 阅读 · 1 评论