
BUG解决
Harry嗷
礼貌提问才会礼貌回答,伸手党勿扰!仅讨论知识,不帮人调bug哈。
展开
-
[Ubuntu] set screen resolution
rt原创 2022-09-29 22:52:37 · 489 阅读 · 2 评论 -
[debug] PyTorch报错:ConnectionResetError: [Errno 104] Connection reset by peer
问题描述:使用PyTorch 1.10.0,训练报错:ConnectionResetError: [Errno 104] Connection reset by peer问题解析参见pytorch的issueI believe the issue is only triggered for the case that bothpersistent_workers and pin_memory are turned on and iteration isterminated at the t原创 2022-01-22 21:07:00 · 11605 阅读 · 3 评论 -
[debug] Expected to have finished reduction in the prior iteration before starting a new one.
问题描述训练网络时出现错误:RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one.原因分析参考该issueI met the same issue.But i solved it.The reason is that in my model class, I define a fpn module with 5 level output featu原创 2022-01-11 21:48:36 · 1230 阅读 · 3 评论 -
[debug] RuntimeError: “nll_loss_forward_reduce_cuda_kernel_2d_index“ not implemented for ‘Int‘
问题描述在使用nn.CrossEntropyLoss时出现报错:loss_id = self.IDLoss(id_preds, id_targets)Traceback (most recent call last): File "/home/hgx/pycharm-2020.1.3/plugins/python/helpers/pydev/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, lo原创 2022-01-11 21:20:56 · 12760 阅读 · 4 评论 -
[debug] 延长Linux中sudo密码在终端的有效时间
参考:如何在 Linux 中让 sudo 密码会话的超时更长些问题描述在第一次执行 sudo 命令后,默认情况下密码将保持 15 分钟。某些需要长时间执行且需要sudo权限的命令,如果超过15min的时间上线就会报错。所以需要延长sudo密码在终端的有效时间。解决方法首先使用 sudo 命令以超级用户权限打开 /etc/sudoers 文件,如下所示:sudo gedit /etc/sudoers接着添加下面的默认值,这意味着 sudo 密码提示将会在用户使用 sudo 20 分钟后.原创 2021-07-16 22:23:03 · 1676 阅读 · 0 评论 -
[debug] pycharm在debug模式下一直显示collecting data
在setting --> Build, Execution, Deployment --> Python Debugger下,选中第三项"Gevent compatible"即可原创 2021-07-13 16:53:36 · 923 阅读 · 0 评论 -
[debug] RuntimeError: CUDA error: no kernel image is available for execution on the device
问题描述运行程序时出现报错:RuntimeError: CUDA error: no kernel image is available for execution on the device (launch_kernel at /opt/conda/conda-bld/pytorch_1556653114079/work/aten/src/ATen/native/cuda/Loops.cuh:72)问题原因当前使用的硬件算力不支持相应的pytorch函数,需要更换pytorch到一个合适的版本。原创 2021-07-08 16:05:01 · 1287 阅读 · 3 评论 -
[debug] you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake ……
[debug] you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function ‘cvShowImage’问题描述you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in func原创 2020-11-26 18:51:59 · 1012 阅读 · 1 评论 -
[bug解决] Ubantu打不开Typora:typora error while loading shared libraries libXss.so.1
文章目录问题描述问题分析解决方法问题描述点击typora,会转一会,然后消失。打不开在Terminal输入typora,出现如下报错:typora: error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory问题分析缺少shared libraries,安装即可。解决方法终端输入以下命令:sudo apt-get install l原创 2020-09-28 17:33:46 · 1293 阅读 · 0 评论 -
[TensorFlow] 运行报错:W tensorflowstream_executorplatformdefaultdso_loader.cc59]
[TensorFlow] 运行报错:W tensorflow/stream_executor/platform/default/dso_loader.cc:59]问题描述使用官网的命令下载TensorFlow没有出现问题pip install tensorflow但是运行时出现报错信息:2020-09-20 21:31:45.455714: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load原创 2020-09-21 09:02:11 · 74753 阅读 · 58 评论 -
[bug解决] TensorFlow安装错误:ERROR After October 2020 you may experience errors when installing
文章目录问题描述:解决方案问题描述:用官方提供的命令 pip install tensorflow 下载TensorFlow,得到如下的Error:ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.We recomm原创 2020-09-20 13:46:58 · 4139 阅读 · 1 评论 -
[bug解决] TensorFlow安装错误:ERROR Cannot uninstall ‘wrapt‘
[bug解决] TensorFlow安装错误:ERROR: Cannot uninstall ‘wrapt’.问题描述:根据官网安装教程安装TensorFlow时出现如下报错:ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a part原创 2020-09-20 12:45:38 · 526 阅读 · 0 评论 -
[bug解决] cannot import name ‘_validate_lengths‘ from ‘numpy.lib.arraypad‘
文章目录问题描述:原因分析:解决方案:方案1(不推荐):方案2(推荐):解决步骤:可能遇到的报错问题描述:skimage 报错from skimage import io报错信息如下:cannot import name '_validate_lengths' from 'numpy.lib.arraypad'原因分析:numpy的版本问题,导致_validate_lengths()函数被删除。解决方案:方案1(不推荐):numpy降级。降到一个保留有_validate_lengt原创 2020-09-20 11:57:09 · 2535 阅读 · 0 评论 -
[bug解决] IndentationError unindent does not match any outer indentation level
文章目录问题描述:产生原因:解决方案:问题描述:运行Python代码,出现如下报错:IndentationError: unindent does not match any outer indentation level产生原因:新的Python语法中是不支持的代码对齐中,混用TAB和空格的。一般来说是因为在TAB中混入了空格。解决方案:将对应文件中的空格变为tab。一般来说是我们自己修改了这个文件,直接安装的文件不会出现这个问题。所以想想自己修改了哪个文件,应该就是那个文件出了问题。原创 2020-09-20 11:34:48 · 1207 阅读 · 0 评论 -
[python] 计算对数:numpy.log()和math.log()
numpy.log()和math.log()都可以进行对数运算。但math.log()只能对单个数值 (scalar) 进行运算,如果对数组运算则会报错:TypeError: only size-1 arrays can be converted to Python scalars而numpy.log()则可以对数组进行运算。建议还是用numpy.log(),少用math.log()。...原创 2020-05-05 14:54:12 · 11104 阅读 · 0 评论 -
[python + debug] set()操作对象的元素为字符串,则结果随机排序,使用sorted()函数以固定顺序
文章目录问题描述原因分析解决方式问题描述当我对数据集的字符串类型的label进行编码时,要使用set()函数来提取出所有类别的标签。这样做的结果是,我发现每次画出来的图,每次样本点的颜色都不一样。而颜色代表label,即每次编码得到的label都不一样。而这在统计数量的时候会出现麻烦。比如下面是两次编码的结果:{'Neural_Networks', 'Reinforcement_Lear...原创 2020-03-22 23:27:32 · 464 阅读 · 0 评论 -
[debug+Python] 复制字典不能直接用 ‘=’,要用dict_name.copy()
问题描述当我想要在函数中返回字典dict1,但是后续的操作还要改变dict1。即,字典的后续操作和字典的返回相矛盾。一个思路是,我再定义一个字典dict2,令其等于dict1。然后dict2用于后续更改,dict1作为返回值。即,返回和修改对不同的字典进行。bug描述我直接使用:dict2 = dict1然后dict1作为返回值,dict2用于函数内的后续修改。结果就发现,我对d...原创 2020-03-17 00:18:19 · 352 阅读 · 0 评论 -
[debug] PyCharm 退出 pytest in XXX.py,恢复run XXX.py
问题描述有时候莫名其妙的,运行程序时会从原来的run XXX.py变为pytest in XXX.py,得到下面的界面:解决方法点击 Run --> edit configurations然后将除了Templates之外的文件,点击减号删除掉,最后点击Apply。最后结果如下图:参考博客:pycharm不以pytest方式运行,想要切换回普通模式运行的方法...原创 2020-03-14 23:55:22 · 869 阅读 · 0 评论 -
[Python] 绘制Python代码的函数调用关系:graphviz+pycallgraph
[Python] 绘制Python代码的函数调用关系:graphviz+pycallgraph文章目录[Python] 绘制Python代码的函数调用关系:graphviz+pycallgraph问题描述解决方案先上结果图:下面介绍pip的使用两个pip在下载Anaconda之前,python自己就有一个pip,通过这个pip下载的函数库会储存到它相应的路径,我们称为路径1,对应的是Python的环境。在下载Anaconda之后,通过conda下载的函数库会储存到conda的...原创 2019-08-06 00:52:03 · 5758 阅读 · 2 评论 -
[Python+debug] 设置Python环境变量-Windows10
点开desktop,右键,点击属性。点击高级系统设置。点击环境变量复制要增加的环境变量选中要修改(增加)的环境变量,Path点击新建将要加入的路径,复制过来。然后点击确定。...原创 2020-03-12 11:34:43 · 1204 阅读 · 0 评论 -
[debug] 开源项目的本地使用:使用pip安装的函数库不能被anaconda和pycharm使用+visdom使用 +路径问题
本人在GitHub上下载了一个开源的项目。在PyCharm的项目路径PycharmProjects单独新建了一个project,来单独存放开源项目的文件。选择的是已有的环境。创建project成功后,将下载的文件放到新建的project的文件夹下。项目对于几个第三方函数库的版本有要求,存放于一个.txt文件requirements.txt中。之后在PyCharm中打开main.py,...原创 2019-08-03 17:09:16 · 876 阅读 · 0 评论 -
[debug] 命令行窗口运行.py文件,报错"No module named XXX"
问题描述:在PyCharm中运行.py文件正常,在命令行运行.py文件报错"No module named XXX"原因分析说到底是搜索路径的问题。PyCharm中运行的时候,该项目文件中的其他文件可以被所运行文件调用。也就是说,系统的搜索路径包括。而在命令行窗口运行.py文件的时候,系统的搜索路径并不包括所运行项目文件夹所在的文件夹,于是出现No module named XXX的报错...原创 2019-08-04 15:52:16 · 2583 阅读 · 0 评论 -
[PyTorch] 记录一次PyTorch版本更新
记录一次PyTorch版本更新问题描述:更新PyTorch中遇到的问题。问题1:conda中无法安装PyTorch直观表现为在conda的库中,找不到PyTorch的下载方式。本人的Anaconda是从镜像下载的。不排除其他人可以通过这个方式下载。[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-8zngVAky-1570705870113)(C:\Use...原创 2019-10-10 19:15:36 · 1196 阅读 · 0 评论 -
[debug] 令人智熄的调试:忘记加return
令人智熄的调试:忘记加return问题描述:本人在使用python-opencv进行图片锐化的之后,使用sobel算子提取边缘的时候,使用该语句:x = cv2.Sobel(image, cv2.CV_8S, 1, 0) # 对x求一阶导得到了以下的报错:cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules...原创 2019-09-29 17:44:39 · 301 阅读 · 0 评论 -
[TorchSummary+TorchSnooper] 一次TorchSummary可视化网络的调试+TorchSnooper的第一次实际使用
[已解决]Expected object of backend CPU but got backend CUDA for argument #2 'weight'Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same原创 2019-09-20 15:46:39 · 997 阅读 · 0 评论 -
[debug] “ImportError DLL load failed 找不到指定的程序”的解析和解决办法。
“ImportError DLL load failed 找不到指定的程序”的解析和解决办法。运行程序的时候,发现了ImportError DLL load failed 找不到指定的程序的报错。网上搜了一天多都找不到解决办法,这里我的解决过程整理出来,希望可以帮助到和我遇到一样问题的人。问题描述(不想看可以跳过)首先澄清一点,这个报错不是ModuleNotFoundError: No m...原创 2019-08-18 22:15:44 · 89572 阅读 · 23 评论