benjiebob / SMALViewer

PyQt5 app for viewing SMAL meshes
GNU General Public License v3.0
25 stars 5 forks source link

torch.nn.modules.module.ModuleAttributeError: 'Renderer' object has no attribute 'render_points' #4

Closed monajalal closed 3 years ago

monajalal commented 3 years ago
(base) mona@mona:~/research/3danimals/SMALViewer$ python smal_viewer.py 
dict_keys(['f', 'J_regressor', 'kintree_table', 'weights', 'posedirs', 'v_template', 'shapedirs'])
torch.Size([4, 3889])
 Tensor J_regressor shape:  torch.Size([37, 3889])
 Tensor weights shape:  torch.Size([3889, 33])
 Tensor posedirs shape:  torch.Size([3889, 3, 288])
 Tensor v_template shape:  torch.Size([3889, 3])
 Tensor shapedirs shape:  torch.Size([3889, 3, 41])
 Tensor faces shape:  torch.Size([7774, 3])
Traceback (most recent call last):
  File "smal_viewer.py", line 13, in <module>
    main()
  File "smal_viewer.py", line 6, in main
    main_window = pyqt_viewer.MainWindow()
  File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 50, in __init__
    self.setup_ui()
  File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 219, in setup_ui
    self.update_render()
  File "/home/mona/research/3danimals/SMALViewer/pyqt_viewer.py", line 241, in update_render
    rendered_images, rendered_silhouettes, rendered_joints, verts, joints_3d = self.model_renderer(self.smal_params)
  File "/home/mona/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/mona/research/3danimals/SMALViewer/smal/smal3d_renderer.py", line 45, in forward
    rendered_joints = self.renderer.render_points(joints_3d[:, self.smal_info.include_classes])
  File "/home/mona/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 772, in __getattr__
    type(self).__name__, name))
torch.nn.modules.module.ModuleAttributeError: 'Renderer' object has no attribute 'render_points'
benjiebob commented 3 years ago

This occurs because the code was originally set up to use my own fork of Neural Mesh Renderer. Note L82 here. However, I've created a new branch which replaces the dependency on NMR with either pyrender or PyTorch3D and targets latest SMAL version etc. I'll push this to master soon!

monajalal commented 3 years ago

Screenshot from 2020-09-26 21-18-36 Thank you so much. It works great.