yifita / DSS

Differentiable Surface Splatting
441 stars 31 forks source link

"guided_scatter_maps_kernel" not implemented for 'Bool' #1

Closed gafniguy closed 4 years ago

gafniguy commented 5 years ago

Hi,

I'm trying to run any of the demo scripts and getting this error from the CUDA section. It is running on a fresh conda environment configured with the requirements file with CUDA 10. Any idea?

Thanks for making the project available.

` Traceback (most recent call last): File "learn_shape_from_target.py", line 105, in baseline=opt.baseline, benchmark=opt.benchmark)

File "learn_shape_from_target.py", line 35, in trainShapeOnImage trainer.create_reference(refScene)

File "/home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/utils/trainer.py", line 147, in create_reference self.groundtruths = renderScene(refScene, self.opt, self.cameras) File "/home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/utils/trainer.py", line 92, in renderScene result = splatter.render().detach()

File "/home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/core/renderer.py", line 882, in render

self.local_occlusion = guided_scatter_maps(numPoint, occludedMap.unsqueeze(-1), pointIdxMap, boundingBoxes)

RuntimeError: "guided_scatter_maps_kernel" not implemented for 'Bool' (operator() at DSS/cuda/rasterize_forward_cuda_kernel.cu:339)

frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x47 (0x7fc9c4702e37 in /home/guygafni/anaconda3/envs/DSS/lib/python3.7/site-packages/torch/lib/libc10.so)

frame #1: + 0x3733b (0x7fc99b53133b in /home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/cuda/rasterize_forward.cpython-37m-x86_64-linux-gnu.so)

frame #2: guided_scatter_maps_cuda(long, at::Tensor const&, at::Tensor const&, at::Tensor const&) + 0x358 (0x7fc99b53178b in /home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/cuda/rasterize_forward.cpython-37m-x86_64-linux-gnu.so)

frame #3: guided_scatter_maps(long, at::Tensor const&, at::Tensor const&, at::Tensor const&) + 0x9e (0x7fc99b51ba2e in /home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/cuda/rasterize_forward.cpython-37m-x86_64-linux-gnu.so)

frame #4: + 0x30e7b (0x7fc99b52ae7b in /home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/cuda/rasterize_forward.cpython-37m-x86_64-linux-gnu.so)

frame #5: + 0x2c8f0 (0x7fc99b5268f0 in /home/guygafni/projects/point_cloud_render/neural_textures/DSS/DSS/cuda/rasterize_forward.cpython-37m-x86_64-linux-gnu.so)

frame #28: __libc_start_main + 0xf0 (0x7fca04247830 in /lib/x86_64-linux-gnu/libc.so.6) `
katadam100 commented 5 years ago

I get the exact same error, with cuda 10.

krrish94 commented 5 years ago

I run into the same error too. (I'm using CUDA 10.0; also tried with CUDA 9.2, if it helps).

krrish94 commented 5 years ago

I got around the error by adding a line here https://github.com/yifita/DSS/blob/master/DSS/core/renderer.py#L881

I cast occludedMap to float() by adding a line just below the line referenced above

occludedMap = occludedMap.float()

However, I don't know if that should indeed be the fix. Maybe @yifita can comment.

yifita commented 5 years ago

This is an issue due to a breaking change in pytorch 1.2.0. Boolean is no longer interpreted as uint8. The solution posted by @krrish94 works. On the other hand, one can also change the map to uint8.

I got around the error by adding a line here https://github.com/yifita/DSS/blob/master/DSS/core/renderer.py#L881

I cast occludedMap to float() by adding a line just below the line referenced above

occludedMap = occludedMap.float()

However, I don't know if that should indeed be the fix. Maybe @yifita can comment.

yifita commented 4 years ago

I've updated the requirements.txt so that now pytorch 1.1.0 should be used. This should fix this compatibility issue.