DECA
DECA copied to clipboard
跑通colab的提示。
感谢团队提供了优秀的代码。 作为flame的老粉。 本项目是用colab跑的,个人不喜欢在colab上跑conda,别介意。
发帖为了给其他人提示,防止#78的错误和tensor错误:Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.) 由于使用DECA。colab的pytorch3d只有0.3.0。 所以,编译安装了pytorch3d的0.6.1,极方便,避免#78的问题。
对于tensor错误:Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.) 以下文件: /content/drive/MyDrive/PIXIE/pixielib/visualizer.py 第113行,flame_texture = flame_texture[0].cpu().numpy().transpose(1,2,0) 建议修改为: flame_texture = flame_texture[0].cpu().detach().numpy().transpose(1,2,0)
Yes, I also run into this problem in DECA project.
File "demos/demo_transfer.py", line 131, in <module>
main(parser.parse_args())
File "demos/demo_transfer.py", line 84, in main
deca.save_obj(os.path.join(savefolder, name, save_type, name + '.obj'), opdict)
File "/content/DECA/decalib/deca.py", line 299, in save_obj
displacement_map = opdict['displacement_map'][i].cpu().numpy().squeeze()
RuntimeError: Can't call numpy() on Tensor that requires grad. Use tensor.detach().numpy() instead.
I fixed this by adding .detach()
before .numpy()
.
displacement_map = opdict['displacement_map'][i].cpu().detach().numpy().squeeze()