Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crashes with recent versions of PyTorch #4

Closed
wants to merge 1 commit into from
Closed

Fixed crashes with recent versions of PyTorch #4

wants to merge 1 commit into from

Conversation

n8xm
Copy link

@n8xm n8xm commented Jun 5, 2020

With the current stable version of PyTorch (1.5 at time of writing), MentisOculi crashes for three reasons:

First, subtraction is used with bool tensors, resulting in the following error:

RuntimeError: Subtraction, the `-` operator, with a bool tensor is not supported. If you are trying to invert a mask, use the `~` or `logical_not()` operator instead.

Second, computing the value of is_first in the getFirstOcc function causes the following error to be thrown:

RuntimeError: Expected object of scalar type unsigned char but got scalar type bool for sequence element 1.

Changing the first element in the list from btype([1]) to btype([1]).bool() fixes this problem.

Third, Writing the image to file in the save_img function fails when using CUDA unless I explicitly copy the image to CPU using img = img.cpu.

I have fixed all three of these problems in this pull request, and MentisOculi appears to be able to render the "ring" image correctly. (I have not tested with the Cornell box.)

Caveat: While executing, the application repeatedly prints the following deprecation warning:

../aten/src/ATen/native/IndexingUtils.h:19: UserWarning: indexing with dtype torch.uint8 is now deprecated, please use a dtype torch.bool instead.

I have not fixed this. However, it does not stop the renderer from working.

@n8xm n8xm closed this Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant