Skip to content

Does PyTorch3D support autocast? #297

Open
@tejank10

Description

@tejank10

Hi,
I was wondering if current release of PyTorch3D intends to support the latest amp and autocast features of PyTorch 1.6. I tried rendering a mesh with autocast enabled, but it was giving the following error. Is the current supposed to support it? If not, then is this feature planned for future releases?

Thanks.

  File "demo.py", line 158, in <module>
    pyrendering = renderer(mesh)
  File "/home/vikrant/CMR_expts/cmr_amp_env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/vikrant/pytorch3d/pytorch3d/renderer/mesh/renderer.py", line 48, in forward
    fragments = self.rasterizer(meshes_world, **kwargs)
  File "/home/vikrant/CMR_expts/cmr_amp_env/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/vikrant/pytorch3d/pytorch3d/renderer/mesh/rasterizer.py", line 120, in forward
    meshes_screen = self.transform(meshes_world, **kwargs)
  File "/home/vikrant/pytorch3d/pytorch3d/renderer/mesh/rasterizer.py", line 102, in transform
    verts_view = cameras.get_world_to_view_transform(**kwargs).transform_points(
  File "/home/vikrant/pytorch3d/pytorch3d/renderer/cameras.py", line 149, in get_world_to_view_transform
    world_to_view_transform = get_world_to_view_transform(R=self.R, T=self.T)
  File "/home/vikrant/pytorch3d/pytorch3d/renderer/cameras.py", line 839, in get_world_to_view_transform
    R = Rotate(R, device=R.device)
  File "/home/vikrant/pytorch3d/pytorch3d/transforms/transform3d.py", line 511, in __init__
    _check_valid_rotation_matrix(R, tol=orthogonal_tol)
  File "/home/vikrant/pytorch3d/pytorch3d/transforms/transform3d.py", line 702, in _check_valid_rotation_matrix
    orthogonal = torch.allclose(R.bmm(R.transpose(1, 2)), eye, atol=tol)
RuntimeError: Half did not match Float

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions