写点什么

mmdetection 训练数据遇到的问题

作者:代码的路
  • 2023-01-13
    江苏
  • 本文字数:2449 字

    阅读完需:约 8 分钟

原文链接

1 Permission denied

报错:


-bash: ./compile.sh: Permission denied


没有操作权限,改为赋予最高权限(777):


chmod 777 compile.sh
复制代码

2 cuda 问题

报错:


unable to execute '/usr/local/cuda-9.0/bin/nvcc': No such file or directory

error: command '/usr/local/cuda-9.0/bin/nvcc' failed with exit status 1


找不到 cuda 下 nvcc 文件,需要找到自己的 nvcc 文件所在地,然后输入:


./compile.sh \ --export CUDA_HOME=/usr/local/cuda-8.0/bin
复制代码


如果还不行,需要查看一下是否有 nvcc:


nvcc --version
复制代码

2.1 nvcc 正常

若 nvcc 正常,设置 cuda 路径首先执行:


sudo vim ~/.bashrc
复制代码


设置为:


export PATH=/usr/local/cuda-9.0/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
复制代码


然后执行:


sudo vim /etc/profile
复制代码


末尾添加:


export CUDA_HOME=/usr/local/cuda-9.0export PATH=/MATLAB/R2016b/bin:/usr/local/cuda-9.0/bin:/anaconda3/bin:$PATHexport LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH
复制代码


然后执行


source /etc/profile
复制代码


使链接生效

2.2 command not found

报错:


-bash: nvcc: command not found


应该安装 nvcc:


sudo apt-get install nvidia-cuda-toolkit
复制代码


报错:


E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


升级 apt-get update:


sudo apt-get update
复制代码


报错:


Failed to connect to nvidia.github.io port 443: Connection timed out

2.2.1 修改源

则应该修改源:


(1)修改前先做备份:


sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
复制代码


(2)打开 sources.list 文件:


sudo vim /etc/apt/sources.list
复制代码


替换为其他源:


清华源:


# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiversedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricteddeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security universedeb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security multiverse
复制代码


阿里源:


# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricteddeb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial universedeb http://mirrors.aliyun.com/ubuntu/ xenial-updates universedeb http://mirrors.aliyun.com/ubuntu/ xenial multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiversedeb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiversedeb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-propertiesdeb http://archive.canonical.com/ubuntu xenial partnerdeb-src http://archive.canonical.com/ubuntu xenial partnerdeb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricteddeb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-propertiesdeb http://mirrors.aliyun.com/ubuntu/ xenial-security universedeb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
复制代码

2.2.2 修改 nameserver

修改/etc/resolv.conf 文件为:


nameserver 8.8.8.8nameserver 4.2.2.2
复制代码

3 not in the sudoers file

报错:


××× is not in the sudoers file. This incident will be reported.


1.切换到超级用户 root:


su root
复制代码


2.查看/etc/sudoers 权限:


 ls -all /etc/sudoers
复制代码


可以看到当前权限为 744:


-r--r----- 1 root root 744 4 月 16 20:36 /etc/sudoers


3.更改权限为 777(表示允许操作):


chmod 777 /etc/sudoers
复制代码


4.编辑/etc/sudoers:


vi /etc/sudoers
复制代码


5.在 root ALL=(ALL:ALL) ALL 下面添加一行:


XXX    ALL=(ALL)ALL
复制代码


其中XXX表示当前用户名


6.把/etc/sudoers 权限改回 440:


chmod 440 /etc/sudoers
复制代码


然后就可以切换回自己的用户操作了

4 ASSERT

报错:


ASSERT: "false" in file qasciikey.cpp, line 501


OpenCV 版本不对,没有里面没有 tracker。安装 contrib 的 OpenCV:


pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-contrib-python
复制代码


如果提示使用--user


pip install --user -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-contrib-python
复制代码

5 no commands supplied

报错:


no commands supplied


应该将 python setup.py 改为 python setup.py install

6 FileNotFoundError

报错:


[Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', /home/snowstorm/mmdetection']


磁盘空间已满,清理空间。


学习更多编程知识,请关注我的公众号:


代码的路



发布于: 刚刚阅读数: 2
用户头像

代码的路

关注

公众号:代码的路 2023-01-10 加入

Java、Python、C++、图像处理、深度学习相关知识分享

评论

发布
暂无评论
mmdetection训练数据遇到的问题_Python_代码的路_InfoQ写作社区