一.Opencv-python的安装问题
流程:
# 也可使用清华镜像pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
pip install opencv-python
安装完成后,出现报错:
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
解决方案参考: https://blog.csdn.net/weixin_61057398/article/details/128047079
1.Ubuntu系统
apt-get update
apt-get install libglib2.0-dev
2.CenOS系统
yum update
yum install mesa-libGL.x86_64
opencv的报错如下:
python调用opencv提示“Rebuild the library with Windows, GTK+ 2.x or Cocoa support”
原文链接: https://blog.csdn.net/shenguo_1984/article/details/119883063
解决方案:
虽然已需要opencv-contrib,但仍需安装opencv-contrib-python,如下,在终端输入命令进行安装:
pip install opencv-contrib-python
二、centos7系统,中文显示乱码
参考:https://blog.csdn.net/weixin_43847283/article/details/125708397
1.查看是否安装中文包
可以使用下面的命名查看系统是否安装了中文安装包。
locale -a |grep "zh_CN"
结果:
[root@k8s-node1 ~]# locale -a |grep "zh_CN"
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbkzh_CN.utf8
没有输出,说明没有安装,输入下面的命令安装:
yum groupinstall "fonts" -y
2 修改配置文件
使用命令修改locale.conf配置文件:
# localectl set-locale LANG=zh_CN
# source /etc/locale.conf # 生效
之后查看当前语言环境:
# echo $LANG
zh_CN
3. 验证是否成功
# date
2023年 01月 11日 星期三 10:33:54 CST
三、window的ssh连接服务器
CMD连接命令
ssh wcp@192.168.133.130
报错为:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:MiLQEZF3MzhLm3uhG/Jnm6wWUxZaQ4I+HiRLLRrErQM.
Please contact your system administrator.
Add correct host key in C:\\Users\\asus/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\asus/.ssh/known_hosts:6
ECDSA host key for 192.168.133.130 has changed and you have requested strict checking.
Host key verification failed.
解决方案:
1、window系统解决办法:
(1)进入--》 c:\users\用户名\
(2)直接删除.ssh文件夹即可。
2、linux解决办法:
(1)先cat一下家目录的.ssh/know_hosts
(2)vim ~/.ssh/known_hosts
(3)删除192.168.133.130的相关rsa的信息即可.
四、pytorch分布式训练
报错:
RuntimeError: Distributed package doesn‘t have NCCL built in
问题:
- windows不支持NCCL backend
解决方案:
torch.distributed.init_process_group(
'nccl',
xxx
)
改为:
torch.distributed.init_process_group(
'gloo',
xxx
)
参考网址:
https://blog.csdn.net/weixin_44414948/article/details/118150711
【解决】RuntimeError: Distributed package doesn‘t have NCCL built in_runtimeerror: distributed package doesn't have ncc-CSDN博客
五、 在linux部署模型时,nginx出现报错
重新优化nginx管理以后,检查配置文件是配置正确的,但 启动nginx确报错了
报错显示nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
查看nginx的端口(nginx使用的端口为80)
netstat -natp |grep 80
发现可能是之前的nginx服务自己占用80端口,导致不能启动,把他的进程全部杀掉,再重启服务,就能成功了
killall -9 nginx
/usr/local/nginx/sbin/nginx # 这里是自己安装nginx的地址下的sbin/nginx文件
六、Window系统,Anaconda虚拟环境安装路径问题
解决新创建的anaconda环境在C:\Users\xxx\.conda\envs\,而不在anaconda安装目录下的envs中
解决问题的网址: https://blog.csdn.net/qq_41664159/article/details/128121225
七、Ubuntu中sudo apt update出问题
无法找到文件
解决方法:
(原文链接: https://blog.csdn.net/wm_python/article/details/103455125)
# 进入/etc/apt/目录,将该目录下sources.list.d/及里面的内容全部删除,运行一下命令:
sudo rm -r /etc/apt/sources.list.d/
# 然后重新运行:
sudo apt-get update。
# 再次用apt-get安装软件就可以了,亲测成功。
八、Ubuntu系统,Pycharm运行TensorRT项目报错
ImportError:libnvparsers.so8: cannot open shared object file: No such file or directory
# 解决方案
将TensorRT的lib目录下,对应上面报错的libnvparsers.so8,复制到/Usr/var中
九、docker调用gpu报错
出现问题:docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
解决方法:
# centos系统解决方法:
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
yum clean expire-cache
yum install -y nvidia-docker2
systemctl restart docker
十、torchaudio 加载wav报错
在使用
torchaudio .load
加载音频的时候报错:Couldn’t find appropriate backend to handle uri *** and format None
解决方案:
1.检查自己的音频路径是否有问题。
2.确认自己的wav音频格式是否正确。
3.可能是缺少音频库,通过 pip install pysoundfile来安装音频库