官方没有给环境文件,靠自己摸索出来的
结论
创建虚拟环境时指定 python=3.9,依次运行下述指令
conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge
conda install -c fvcore -c iopath -c conda-forge fvcore iopath
conda install pytorch3d -c pytorch3d
安装的版本如下
环境问题解决!
解决过程
踩坑记录
报错1
libcudart.so.10.1: cannot open shared object file: No such file or directory
这是CUDA版本和pytorch的适配问题
当时在网上找到3种可能解决方案如下:
-
ada
按照DenseDepth的要求安装,python=3.7, cudatoolkit=10.0
Requirements
- This code is tested with Keras 2.2.4, Tensorflow 1.13, CUDA 10.0, on a machine with an NVIDIA Titan V and 16GB+ RAM running on Windows 10 or Ubuntu 16.
- Other packages needed
keras pillow matplotlib scikit-learn scikit-image opencv-python pydot
andGraphViz
for the model graph visualization andPyGLM PySide2 pyopengl
for the GUI demo. - Minimum hardware tested on for inference NVIDIA GeForce 940MX (laptop) / NVIDIA GeForce GTX 950 (desktop).
- Training takes about 24 hours on a single NVIDIA TITAN RTX with batch size 8.
Version | Python version | Compiler | Build tools | cuDNN | CUDA |
---|---|---|---|---|---|
tensorflow_gpu-1.13.0 | 3.5-3.7 | MSVC 2015 update3 | Bazel 0.19.0-0.21.0 | 7.4 | 10 |
-
pytorch3d
按照博客安装http://t.csdn.cn/6PQHQ,python=3.8, pytorch=1.7.1, cudatoolkit=10.2
-
pt3d
按照官网安装
https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md
报错2
一个问题接一个问题。。。
cannot import name ‘OpOverloadPacket’ from ‘torch._ops’
这是pytorch版本问题
报错3
module ‘torch._C’ has no attribute ‘DoubleStorageBase’
到这一步就完全确定是pytorch版本问题,且python版本也要相应改动
最后新建一个环境全部从头试出了开头说的结论