And it fails:
Traceback (most recent call last):
File "examples/recon/test.py", line 122, in
test()
File "examples/recon/test.py", line 89, in test
batch_iou, vertices, faces = model(images, voxels=voxels, task='test')
File "/home/user/anaconda3/envs/softras/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/user/Projects/SoftRas/examples/recon/models.py", line 153, in forward
return self.evaluate_iou(images, voxels)
File "/home/user/Projects/SoftRas/examples/recon/models.py", line 144, in evaluate_iou
voxels_predict = srf.voxelization(faces_norm, 32, False).cpu().numpy()
File "/home/user/anaconda3/envs/softras/lib/python3.7/site-packages/soft_renderer-1.0.0-py3.7-linux-x86_64.egg/soft_renderer/functional/voxelization.py", line 58, in voxelization
voxels = voxelize_sub3(faces, voxels)
File "/home/user/anaconda3/envs/softras/lib/python3.7/site-packages/soft_renderer-1.0.0-py3.7-linux-x86_64.egg/soft_renderer/functional/voxelization.py", line 31, in voxelize_sub3
voxels, visible = voxelization_cuda.voxelize_sub3(faces, voxels, visible)
RuntimeError: voxels must be contiguous
Solved this issue by adding voxels = voxels.contiguous() in the voxelization function in soft_renderer/functional/voxelization.py
Hi, I am trying to run the
examples/recon/test.py
file with the following command: `python examples/recon/test.py -eid recon \And it fails: Traceback (most recent call last): File "examples/recon/test.py", line 122, in
test()
File "examples/recon/test.py", line 89, in test
batch_iou, vertices, faces = model(images, voxels=voxels, task='test')
File "/home/user/anaconda3/envs/softras/lib/python3.7/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/user/Projects/SoftRas/examples/recon/models.py", line 153, in forward
return self.evaluate_iou(images, voxels)
File "/home/user/Projects/SoftRas/examples/recon/models.py", line 144, in evaluate_iou
voxels_predict = srf.voxelization(faces_norm, 32, False).cpu().numpy()
File "/home/user/anaconda3/envs/softras/lib/python3.7/site-packages/soft_renderer-1.0.0-py3.7-linux-x86_64.egg/soft_renderer/functional/voxelization.py", line 58, in voxelization
voxels = voxelize_sub3(faces, voxels)
File "/home/user/anaconda3/envs/softras/lib/python3.7/site-packages/soft_renderer-1.0.0-py3.7-linux-x86_64.egg/soft_renderer/functional/voxelization.py", line 31, in voxelize_sub3
voxels, visible = voxelization_cuda.voxelize_sub3(faces, voxels, visible)
RuntimeError: voxels must be contiguous
Solved this issue by adding
voxels = voxels.contiguous()
in thevoxelization
function insoft_renderer/functional/voxelization.py