PointContrast环境配置教程

CUDA和cuDNN

CUDA=10.2
cuDNN=8.2.0

# 先看看有没有装好的cuDNN
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
# 或者
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

没有下好cuDNN的话,就先去官网下好4个文件,解压tar文件,然后:

cp cuda/include/* /usr/local/cuda-10.2/include/
cp cuda/lib64/* /usr/local/cuda-10.2/lib64/
chmod +x /usr/local/cuda-10.2/include/cudnn.h
chmod +x /usr/local/cuda-10.2/lib64/libcudnn*
cat /usr/local/cuda/include/cudnn_version.h | grep CUDNN_MAJOR -A 2

查看cuDNN版本

安装pytorch1.5.1

装之前看看代理有没有设置好,conda能不能用。
能用的话,就创建一个新环境

conda create -n pointcontrast python=3.7

记得在 ~/.zshrc 里复制 ~/.bashrc 里的conda信息。然后source ~/.zshrc。

conda activate pointcontrast
# CUDA 10.2
conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.2 -c pytorch

下载的时候如果太慢了,就给conda换源

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

再次安装pytorch

conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.2

划重点!!安装MinkowskiEngine0.4.3

按照ContrastiveSceneContexts安装MinkowskiEngine0.4.3

# Install virtual env and PyTorch
conda create -n sparseconv043 python=3.7
conda activate sparseconv043
conda install pytorch==1.5.1 torchvision==0.6.1 cudatoolkit=10.2 -c pytorch
# 以上这些其实刚刚已经做过了,这个是官方给的

# Complie and install MinkowskiEngine 0.4.3.
conda install mkl mkl-include -c intel
wget https://github.com/NVIDIA/MinkowskiEngine/archive/refs/tags/v0.4.3.zip
unzip v0.4.3.zip
cd MinkowskiEngine-0.4.3 
python setup.py install

如果报错的话,可以试试声明一下环境变量

# 这两句声明很重要!
export CXX=c++
export CUDA_HOME=/usr/local/cuda-10.2

安装hydra

# Install Hydra by:
pip install hydra-core --upgrade

安装其他库

git clone https://github.com/facebookresearch/PointContrast.git
cd PointContrast
pip install -r requirements.txt

可能遇到的问题

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

这是缺少依赖项,要安装一下
解决方法:

apt update
apt install libgl1-mesa-glx

hydra 报错

问题1:

In 'hydra/config': Could not find 'hydra/hydra_logging/colorlog'

解决方法:

pip install -U hydra_colorlog

问题2:

hydra.errors.MissingConfigException: In 'hydra/config': Could not find 'hydra/launcher/submitit_slurm'

解决方法:

pip install hydra-submitit-launcher --upgrade

做Finetune的时候还需要装一个库

pip install pykeops

config.pretty()报错:

解决方法:

#logging.info(config.pretty())
  logging.info(OmegaConf.to_yaml(config))
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值