MMdetection多卡训练常遇到的两个错误,百度无果,没解决,去github里mmdetection的issue模块搜索了一下找到正解

这里记录一下,方便后者。

1️⃣ ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running

matplotlib版本过高导致的,卸载你的环境中matplotlib高版本,下载3.2.1版本。亲测管用,ubantu18.04

pip uninstall matplotlib
pip install matplotlib==3.2.1

2️⃣ RuntimeError: Address already in use

(mmdet) zdx@zdx-MS:/home/User/gaoying/cv/mmdetection$ bash tools/dist_train.sh work_dirs/mchar/cascade_rcnn_r50_fpn_1x_job1/cascade_rcnn_r50_fpn_1x_job1.py 2

*****************************************
Setting OMP_NUM_THREADS environment variable for each process to be 1 in default, to avoid your system being overloaded, please further tune the variable for optimal performance in your application as needed.
*****************************************
Traceback (most recent call last):
File "tools/train.py", line 185, in <module>
main()
File "tools/train.py", line 117, in main
init_dist(args.launcher, **cfg.dist_params)
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/site-packages/mmcv/runner/dist_utils.py", line 18, in init_dist
_init_dist_pytorch(backend, **kwargs)
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/site-packages/mmcv/runner/dist_utils.py", line 32, in _init_dist_pytorch
dist.init_process_group(backend=backend, **kwargs)
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/site-packages/torch/distributed/distributed_c10d.py", line 423, in init_process_group
store, rank, world_size = next(rendezvous_iterator)
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/site-packages/torch/distributed/rendezvous.py", line 179, in _env_rendezvous_handler
store = TCPStore(master_addr, master_port, world_size, start_daemon, timeout)
RuntimeError: Address already in use
Traceback (most recent call last):
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/site-packages/torch/distributed/launch.py", line 260, in <module>
main()
File "/home/zdx/anaconda3/envs/mmdet/lib/python3.7/site-packages/torch/distributed/launch.py", line 256, in main
cmd=cmd)
subprocess.CalledProcessError: Command '['/home/zdx/anaconda3/envs/mmdet/bin/python', '-u', 'tools/train.py', '--local_rank=1', 'work_dirs/mchar/cascade_rcnn_r50_fpn_1x_job1/cascade_rcnn_r50_fpn_1x_job1.py', '--launcher', 'pytorch']' returned non-zero exit status 1.

在一台计算机上多次使用多GPU出现错误,把之前运行的都kill掉就好了,具体方法是:

用htop命令查看一下,之前运行命令的pid。如果没有安装htop的话,自行百度安装一下。

htop



点击Command,按命令进行排序。可以看到我们之前运行的程序的pid为5579。把包含这个命令的都杀死。kill -9表示强制杀死

kill -9 5579

又可以愉快的训练啦

ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running的更多相关文章

  1. kivy sdl2 - ImportError: DLL load failed: 找不到指定的模块

    from kivy.app import App from kivy.uix.button import Button class TestApp(App): def build(self): ret ...

  2. from _sqlite3 import * ImportError: DLL load failed: 找不到指定的模块。

    *Error creating Django application: Error on python side. Exit code: 1, err: Traceback (most recent ...

  3. Python报错 ImportError: DLL load failed while importing win32api: %1 不是有效的 Win32 应用程序 的解决方法

    今天在用jupyter notebook 的时候发生了kernel error,点开之后提示了以下报错信息 Traceback (most recent call last): File " ...

  4. python ImportError: DLL load failed: %1 不是有效的 Win32 应用程序

    导入的时候报出了 ImportError 在windows上安装python 的模块后,导入模块时报 python ImportError: DLL load failed: %1 不是有效的 Win ...

  5. pywin32 安装错误 ImportError: DLL load failed: 不是有效的 Win32 应用程序

    pywin32 安装错误 ImportError: DLL load failed:  不是有效的 Win32 应用程序. 发现是因为没有制定Pywin32的dll所致,我们在用Pywin32开发时, ...

  6. python安装win32api pywin32 后出现 ImportError: DLL load failed

    ImportError: DLL load failed: \xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xc4\xa3\xbf\xe9\xa1\x ...

  7. python——报错ImportError:DLL load failed with error code -1073741795的解决方式

    python中导入一个包,import cv2总是报错'ImportError:DLL load failed with error code -1073741795',报错形式: 网上找了好久的解决 ...

  8. pip install torch on windows, and the 'from torch._C import * ImportError: DLL load failed:' solution

    通过pip安装PyTorch 0.4.0成功(cpu, not gpu; python3.5; pip): pip3 install http://download.pytorch.org/whl/c ...

  9. kivy sdl2 - ImportError: DLL load failed: 找不到指定的模块。

    kivy version : windows:win python version:3.6 sdl2 - ImportError: DLL load failed: 找不到指定的模块. 运行以下dem ...

  10. [Eclipse+PyDev]ImportError: DLL load failed:找不到指定的模块 解决方案

    1. 环境 Eclipse 4.4.2 Python 3.5 Window 8.1 2. 问题 在代码中import numpy时,提示 " ImportError: DLL load fa ...

随机推荐

  1. 数据湖&湖仓一体简介

    1 简介 术语 数据库 数据库是"按照数据结构来组织.存储和管理数据的仓库". 广义上的数据库,在20世纪60年代已经在计算机中应用了.但这个阶段的数据库结构主要是层次或网状的,且 ...

  2. Mysql导出导入操作

    安装mysql客户端 # 在终端上下载mysql源 wget https://dev.mysql.com/get/mysql80-community-release-el7-7.noarch.rpm ...

  3. c语言之遗漏---标准C的标记化结构初始化语法

    PS:要转载请注明出处,本人版权所有. PS: 这个只是基于<我自己>的理解, 如果和你的原则及想法相冲突,请谅解,勿喷. 前置说明   本文发布于 2015-12-29 19:22:14 ...

  4. CSS(三大特性、盒子模型的组成(boder、padding、margin)、ps基本操作)

    一.css三大特性 1.层叠性 相同选择器给设置相同的样式,此时一个样式就会覆盖(层叠)另一个冲突的样式.层叠性主要解决样式冲突的问题 层叠性原则: 样式冲突,遵循的原则是就近原则,哪个样式离结构近, ...

  5. CentOS 安装webmin

    下载地址 http://download.webmin.com/download/yum/ 安装依赖 sudo yum -y install openssl perl perl-Net-SSLeay ...

  6. C#无需第三方插件实现json和table互转

    using System; using System.Collections.Generic; using System.Collections; using System.Linq; using S ...

  7. read IEEE Standard for verilog(1)

    IEEE Standard for Verilog Hardware Description Language 英语说明阅读,首先看导读.目录.摘要等内容. 摘要: 1 Abstract: The V ...

  8. KingbaseES V8R6集群运维案例之---sys_monitor.sh start启动动态库错误

    案例说明: 在KingbaseES V8R6集群部署了postgis后,执行sys_monitor.sh start启动集群时,出现动态库错误,如下图所示: 适用版本: KingbaseES V8R6 ...

  9. Scala 惰性加载

    1 package com.atguigu.chapter04 2 3 object Test_Lazy { 4 def main(args: Array[String]): Unit = { 5 l ...

  10. 5W1H聊开源之What——开源协议有哪些?

    开源许可协议是指开源社区为了维护作者和贡献者的合法权利,保证软件不被一些商业机构或个人窃取,影响软件的发展而开发的协议.开源协议规定了用户在使用开源软件时的权利和责任,虽然不一定具备法律效力,但是当涉 ...