代码地址
https://github.com/princeton-vl/RAFT-3D
配置环境
1.创建环境
conda create -n raft3d python=3.8
conda activate raft3d
2.安装库
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
sudo apt-get install libsuitesparse-dev
pip install scikit-sparse
conda install pyyaml
pip install opencv-python==4.5.2.52 open3d
pip install git+https://github.com/princeton-vl/lietorch.git
pip install matplotlib tensorboard
库版本参考
packages in environment at /home/ql/miniconda/envs/raft3d:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
absl-py 2.0.0 pypi_0 pypi
addict 2.4.0 pypi_0 pypi
ansi2html 1.8.0 pypi_0 pypi
asttokens 2.4.1 pypi_0 pypi
attrs 23.1.0 pypi_0 pypi
backcall 0.2.0 pypi_0 pypi
blas 1.0 mkl
blinker 1.7.0 pypi_0 pypi
bzip2 1.0.8 h7f98852_4 conda-forge
ca-certificates 2023.08.22 h06a4308_0
cachetools 5.3.2 pypi_0 pypi
certifi 2023.7.22 pypi_0 pypi
charset-normalizer 3.3.2 pypi_0 pypi
click 8.1.7 pypi_0 pypi
comm 0.2.0 pypi_0 pypi
configargparse 1.7 pypi_0 pypi
contourpy 1.1.1 pypi_0 pypi
cudatoolkit 11.1.1 ha002fc5_10 conda-forge
cycler 0.12.1 pypi_0 pypi
dash 2.14.1 pypi_0 pypi
dash-core-components 2.0.0 pypi_0 pypi
dash-html-components 2.0.0 pypi_0 pypi
dash-table 5.0.0 pypi_0 pypi
decorator 5.1.1 pypi_0 pypi
executing 2.0.1 pypi_0 pypi
fastjsonschema 2.18.1 pypi_0 pypi
ffmpeg 4.3 hf484d3e_0 pytorch
flask 3.0.0 pypi_0 pypi
fonttools 4.44.0 pypi_0 pypi
freetype 2.10.4 h0708190_1 conda-forge
gmp 6.2.1 h58526e2_0 conda-forge
gnutls 3.6.13 h85f3911_1 conda-forge
google-auth 2.23.4 pypi_0 pypi
google-auth-oauthlib 1.0.0 pypi_0 pypi
grpcio 1.59.2 pypi_0 pypi
idna 3.4 pypi_0 pypi
importlib-metadata 6.8.0 pypi_0 pypi
importlib-resources 6.1.1 pypi_0 pypi
intel-openmp 2021.4.0 h06a4308_3561
ipython 8.12.3 pypi_0 pypi
ipywidgets 8.1.1 pypi_0 pypi
itsdangerous 2.1.2 pypi_0 pypi
jedi 0.19.1 pypi_0 pypi
jinja2 3.1.2 pypi_0 pypi
joblib 1.3.2 pypi_0 pypi
jpeg 9b h024ee3a_2
jsonschema 4.19.2 pypi_0 pypi
jsonschema-specifications 2023.7.1 pypi_0 pypi
jupyter-core 5.5.0 pypi_0 pypi
jupyterlab-widgets 3.0.9 pypi_0 pypi
kiwisolver 1.4.5 pypi_0 pypi
lame 3.100 h7f98852_1001 conda-forge
ld_impl_linux-64 2.38 h1181459_1
libffi 3.4.4 h6a678d5_0
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libiconv 1.17 h166bdaf_0 conda-forge
libpng 1.6.37 h21135ba_2 conda-forge
libstdcxx-ng 11.2.0 h1234567_1
libtiff 4.1.0 h2733197_1
libuv 1.43.0 h7f98852_0 conda-forge
lietorch 0.2 pypi_0 pypi
lz4-c 1.9.3 h9c3ff4c_1 conda-forge
markdown 3.5.1 pypi_0 pypi
markupsafe 2.1.3 pypi_0 pypi
matplotlib 3.7.3 pypi_0 pypi
matplotlib-inline 0.1.6 pypi_0 pypi
mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py38h95df7f1_0 conda-forge
mkl_fft 1.3.1 py38h8666266_1 conda-forge
mkl_random 1.2.2 py38h1abd341_0 conda-forge
nbformat 5.7.0 pypi_0 pypi
ncurses 6.4 h6a678d5_0
nest-asyncio 1.5.8 pypi_0 pypi
nettle 3.6 he412f7d_0 conda-forge
ninja 1.11.0 h924138e_0 conda-forge
numpy 1.24.3 py38h14f4228_0
numpy-base 1.24.3 py38h31eccc5_0
oauthlib 3.2.2 pypi_0 pypi
olefile 0.46 pyh9f0ad1d_1 conda-forge
open3d 0.17.0 pypi_0 pypi
opencv-python 4.5.2.52 pypi_0 pypi
openh264 2.1.1 h780b84a_0 conda-forge
openssl 3.0.12 h7f8727e_0
packaging 23.2 pypi_0 pypi
pandas 2.0.3 pypi_0 pypi
parso 0.8.3 pypi_0 pypi
pexpect 4.8.0 pypi_0 pypi
pickleshare 0.7.5 pypi_0 pypi
pillow 10.1.0 pypi_0 pypi
pip 23.3 py38h06a4308_0
pkgutil-resolve-name 1.3.10 pypi_0 pypi
platformdirs 4.0.0 pypi_0 pypi
plotly 5.18.0 pypi_0 pypi
prompt-toolkit 3.0.40 pypi_0 pypi
protobuf 4.25.0 pypi_0 pypi
ptyprocess 0.7.0 pypi_0 pypi
pure-eval 0.2.2 pypi_0 pypi
pyasn1 0.5.0 pypi_0 pypi
pyasn1-modules 0.3.0 pypi_0 pypi
pygments 2.16.1 pypi_0 pypi
pyparsing 3.1.1 pypi_0 pypi
pyquaternion 0.9.9 pypi_0 pypi
python 3.8.18 h955ad1f_0
python-dateutil 2.8.2 pypi_0 pypi
python_abi 3.8 2_cp38 conda-forge
pytorch 1.8.0 py3.8_cuda11.1_cudnn8.0.5_0 pytorch
pytz 2023.3.post1 pypi_0 pypi
pyyaml 6.0.1 py38h5eee18b_0
readline 8.2 h5eee18b_0
referencing 0.30.2 pypi_0 pypi
requests 2.31.0 pypi_0 pypi
requests-oauthlib 1.3.1 pypi_0 pypi
retrying 1.3.4 pypi_0 pypi
rpds-py 0.12.0 pypi_0 pypi
rsa 4.9 pypi_0 pypi
scikit-learn 1.3.2 pypi_0 pypi
scikit-sparse 0.4.12 pypi_0 pypi
scipy 1.10.1 pypi_0 pypi
setuptools 68.0.0 py38h06a4308_0
six 1.16.0 pyh6c4a22f_0 conda-forge
sqlite 3.41.2 h5eee18b_0
stack-data 0.6.3 pypi_0 pypi
tenacity 8.2.3 pypi_0 pypi
tensorboard 2.14.0 pypi_0 pypi
tensorboard-data-server 0.7.2 pypi_0 pypi
threadpoolctl 3.2.0 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
torchaudio 0.8.0 py38 pytorch
torchvision 0.9.0 py38_cu111 pytorch
tqdm 4.66.1 pypi_0 pypi
traitlets 5.13.0 pypi_0 pypi
typing_extensions 4.8.0 pyha770c72_0 conda-forge
tzdata 2023.3 pypi_0 pypi
urllib3 2.1.0 pypi_0 pypi
wcwidth 0.2.9 pypi_0 pypi
werkzeug 3.0.1 pypi_0 pypi
wheel 0.41.2 py38h06a4308_0
widgetsnbextension 4.0.9 pypi_0 pypi
xz 5.4.2 h5eee18b_0
yaml 0.2.5 h7b6447c_0
zipp 3.17.0 pypi_0 pypi
zlib 1.2.13 h5eee18b_0
zstd 1.4.9 ha95c52a_0 conda-forge
测试
export CUDA_VISIBLE_DEVICES=0python scripts/demo.py --network=raft3d.raft3d --model=./checkpoints/raft3d.pth
注意修改源文件的数据路径地址
解决报错
AttributeError: module ‘distutils‘ has no attribute ‘version‘
pip install setuptools==59.5.0