CUDA和cuDNN
CUDA=10.2 cuDNN=8.2.0
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
安装pytorch1.5.1
装之前看看代理有没有设置好,conda能不能用。 能用的话,就创建一个新环境
conda create -n pointcontrast python=3.7
记得在 ~/.zshrc 里复制 ~/.bashrc 里的conda信息。然后source ~/.zshrc。
conda activate pointcontrast
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
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
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
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
config.pretty()报错:
解决方法:
logging.info(OmegaConf.to_yaml(config))
|