好久之前复现的spin
记录一下spin复现的流程
遇到的问题及解决方案
1、neural-renderer-pytorch
报错如下
ERROR: Command errored out with exit status 1:
command: /opt/tools/anaconda3/envs/spin/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h14mocru/neural-renderer-pytorch_8b882ecd342540559b9a11f7f9d8a604/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h14mocru/neural-renderer-pytorch_8b882ecd342540559b9a11f7f9d8a604/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-sszmdm87
cwd: /tmp/pip-install-h14mocru/neural-renderer-pytorch_8b882ecd342540559b9a11f7f9d8a604/
解决方案
下载源码:https://github.com/daniilidis-group/neural_renderer
然后修改源码中以下三个文件:
neural_renderer/cuda/文件夹下的create_texture_image_cuda.cpp 、load_textures_cuda.cpp 、rasterize_cuda.cpp
将三个文件中所有的 AT_CHECK 替换为 TORCH_CHECK
最后进入到 neural_renderer-master 文件夹下,执行
python setup.py install
2、ImportError: cannot import name ‘ModelOutput’
运行conda list指令后,发现安装的
smplx 是0.1.28版本的,要用0.1.13
pip install smplx==0.1.13
3、smpl_mean_params.npz
FileNotFoundError: [Errno 2] No such file or directory: 'data/smpl_mean_params.npz'
运行以下
./fetch_data.sh
如果出现以下报错
bash: ./fetch_data.sh: Permission denied
运行以下指令
chmod 777 ./fetch_data.sh
或者
chmod +x ./fetch_data.sh
然后再次运行
./fetch_data.sh
4、AssertionError: Path data/smpl does not exist!
File "/opt/tools/anaconda3/envs/spin/lib/python3.6/site-packages/smplx/body_models.py", line 184, in __init__
smpl_path)
AssertionError: Path data/smpl does not exist!
在data文件夹下创建smpl文件夹
5、Path data/smpl/SMPL_NEUTRAL.pkl does not exist!
File "/opt/tools/anaconda3/envs/spin/lib/python3.6/site-packages/smplx/body_models.py", line 184, in __init__
smpl_path)
AssertionError: Path data/smpl/SMPL_NEUTRAL.pkl does not exist!
在smplify官网下载neutral的pkl文件,并将文件名改为SMPL_NEUTRAL.pkl
下载链接: https://smplify.is.tue.mpg.de/
6、ImportError: cannot import name ‘OSMesaCreateContextAttribs’
当前pyopengl版本为3.1.0,卸载后重装3.1.5版本的
pip uninstall pyopengl
pip install pyopengl==3.1.5