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

github: https://github.com/nkolot/SPIN

在这里插入图片描述


在这里插入图片描述

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就能用了

结果

在这里插入图片描述


在这里插入图片描述

调试

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

相关文章

显卡天梯图2024最新版,显卡是电脑进行图形处理的重要设备,...
初始化电脑时出现问题怎么办,可以使用win系统的安装介质,连...
todesk远程开机怎么设置,两台电脑要在同一局域网内,然后需...
油猴谷歌插件怎么安装,可以通过谷歌应用商店进行安装,需要...
虚拟内存这个名词想必很多人都听说过,我们在使用电脑的时候...
win11本地账户怎么改名?win11很多操作都变了样,用户如果想要...