Fixed crashes with recent versions of PyTorch #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Second, computing the value of
is_first
in thegetFirstOcc
function causes the following error to be thrown:Changing the first element in the list from
btype([1])
tobtype([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 usingimg = 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:
I have not fixed this. However, it does not stop the renderer from working.