服务器配置环境

Xterm服务器(Linux) 显卡配置 2080ti

1、连接服务器

服务器ip:202.119.84.91   port:60311     watt

2、安装Anaconda3,选择python3.7

wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
#清华镜像源 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
bash Anaconda3-2020.07-Linux-x86_64.sh

 安装完成后检查是否安装成功

source ~/.bashrc(#重新启动环境变量,一定要输入这条命令!)
python

 3、创建虚拟环境

#创建虚拟环境
conda create -n pytorch python=3.7
#激活虚拟环境
conda activate pytorch
#退出虚拟环境
conda deactivate
#删除虚拟环境
conda remove -n NAME --all

4、查看对应cuda版本

cat /usr/local/cuda/version.txt
# 另一种
nvidia-smi

根据pytorch官网 本地|派托奇 (pytorch.org)​​​​​​

 查看对应的torch版本并安装,支持向下兼容

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

5、测试

输入python 进入编辑环境

import torch

print(torch.__version__)

print(torch.cuda.is_available())

6、安装库

(1)opencv

#安装opencv
pip install opencv_python
#检查(进入python)
import cv2 as cv
print(cv.__version__)

(2)pydensecrf

1、容易在第二步出问题

pip install cpython
pip install pydensecrf

 2、容易因网络问题断开

pip install git+https://github.com/lucasb-eyer/pydensecrf.git

3、比较容易成功

conda install -c conda-forge pydensecrf

7.常见问题

(1)RuntimeError: GET was unable to find an engine to execute this computation

检查:

import torch
print(torch.__version__)
print(torch.cuda.is_available())
print(torch.backends.cudnn.version())

发现错误:RuntimeError: cuDNN version incompatibility: PyTorch was compiled  against (8, 7, 0) but found runtime version (8, 0, 5). PyTorch already comes bundled with cuDNN. One option to resolving this error is to ensure PyTorch can find the bundled cuDNN.Looks like your LD_LIBRARY_PATH contains incompatible version of cudnnPlease either remove it from the path or install cudnn (8, 7, 0)

解决方案:确保PyTorch能找到你安装在虚拟环境中的cuDNN,在终端中添加环境变量:

export LD_LIBRARY_PATH=/path/to/your/venv/lib:$LD_LIBRARY_PATH

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值