I failed to render meshes using SoftRenderer with batch_size=3. Finally, I found that it is because torch.cross is not called with the specific dim parameter.
For example, in soft_renderer/functional/look_at.py, line 49-50
if batch_size=3, then both up.shape and z_axis.shape will be (3, 3).
According to torch documentation,
the dim is not given and it will find the dimension 0 with the size 3 and apply cross product column by column, rather than row by row. To fix the bug, please specify dim=1.
I will not create a pull request since I think I cannot find everywhere the problem occurs. Hope you fix the bug.
I failed to render meshes using SoftRenderer with
batch_size=3
. Finally, I found that it is because torch.cross is not called with the specificdim
parameter.For example, in
soft_renderer/functional/look_at.py
, line 49-50 ifbatch_size=3
, then bothup.shape
andz_axis.shape
will be(3, 3)
. According to torch documentation,the
dim
is not given and it will find the dimension 0 with the size 3 and apply cross product column by column, rather than row by row. To fix the bug, please specifydim=1
.I will not create a pull request since I think I cannot find everywhere the problem occurs. Hope you fix the bug.