代码实现SPIN:Learning to Reconstruct 3D Human Pose and Shape via Model-fitting in the Loop(ICCV 2019)

github: https://github.com/nkolot/SPIN
代码实现SPIN:Learning to Reconstruct 3D Human Pose and Shape via Model-fitting in the Loop(ICCV 2019)_第1张图片
代码实现SPIN:Learning to Reconstruct 3D Human Pose and Shape via Model-fitting in the Loop(ICCV 2019)_第2张图片

在python3.7 torch1.12下安装

依赖问题

先参考github的安装指导

pip install -r requirements.txt

报错neural-renderer-pytorch没有找到’torch’

pip install spacepy

报错没有gfortran编译器

解决方法

先去官网参考自己的版本安装pytorch conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
requirements.txt中把spacepyneural-renderer-pytorch注释掉

numpy
opencv-python
pyopengl
pyrender
scikit-image
scipy
tensorboard
chumpy
smplx
#spacepy
torch
torchgeometry
torchvision
tqdm
trimesh
#neural-renderer-pytorch

spacepy报错应该是没有fortran语言编译器的问题
安装编译器sudo apt-get install gfortran

pip install spacepy
pip install -r requirements.txt 下的慢就换源
pip install neural-renderer-pytorch


补充

如果pip install neural-renderer-pytorch报错 参考下面这些,由于折腾半天,忘记顺序了没有留图

这里报错参考

The detected CUDA version (11.3) mismatches the version that was used to compile
      PyTorch (10.2). Please make sure to use the same CUDA versions.

修改目标文件/home/lrd/.conda/envs/l_SP/lib/python3.7/site-packages/torch/utils/cpp_extension.py 812行

print("raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))")#相当于跳过检测CUDA版本的问题

后再次pip install neural-renderer-pytorch
报错参考

#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x)
                ^~~~~~~~~~
neural_renderer/cuda/load_textures_cuda.cpp:29:5: note: in expansion of macro ‘CHECK_INPUT’
         CHECK_INPUT(faces);
         ^

修改目标文件后再安装neural-renderer-pytorch就能用了

结果

代码实现SPIN:Learning to Reconstruct 3D Human Pose and Shape via Model-fitting in the Loop(ICCV 2019)_第3张图片
代码实现SPIN:Learning to Reconstruct 3D Human Pose and Shape via Model-fitting in the Loop(ICCV 2019)_第4张图片

调试

调试方法参考vscode调试传递参数的python代码

你可能感兴趣的:(三位重建,3d,pytorch,深度学习)