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

Camera parameters cannot be updated and differentiate in batch #16

Closed
HectorAnadon opened this issue Feb 12, 2019 · 2 comments
Closed

Comments

@HectorAnadon
Copy link

HectorAnadon commented Feb 12, 2019

Hello! I report one bug and I have one question:
The bug: following the code structure of the tutorials, when updating the camera each iteration like:
cam.position = torch.tensor([0.0, 0.0, 2.5])
The change is not reflected in the rendered image.
My question: I know batch rendering is not supported, however, is it possible to differentiate over a set of rendered images? I tried to render a set over a loop and differentiate over them and got:

CUDA Runtime Error: device-side assert triggered at /home/hleon/Documents/redner/buffer.h:86
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [38,0,0], thread: [33,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [38,0,0], thread: [35,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [38,0,0], thread: [45,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [38,0,0], thread: [46,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [38,0,0], thread: [47,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [35,0,0], thread: [36,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [35,0,0], thread: [46,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [35,0,0], thread: [47,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [35,0,0], thread: [55,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [36,0,0], thread: [9,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [36,0,0], thread: [20,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [35,0,0], thread: [0,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [35,0,0], thread: [1,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [35,0,0], thread: [25,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [38,0,0], thread: [19,0,0] Assertion isfinite(nee_contrib) failed.
/home/hleon/Documents/redner/pathtracer.cpp:927: void path_contribs_accumulator::operator()(int): block: [38,0,0], thread: [20,0,0] Assertion isfinite(nee_contrib) failed.

Thank you for your help!

@BachiLi
Copy link
Owner

BachiLi commented Feb 12, 2019

It's not exactly a bug, but instead of how Python and PyTorch work : p
Nevertheless I "fixed" the camera parameters in the latest commits. I am working on mini-batching and will get back to you soon.

@BachiLi
Copy link
Owner

BachiLi commented Dec 13, 2019

Batching is supported now: https://colab.research.google.com/github/BachiLi/redner/blob/master/tutorials/batch_rendering.ipynb
It took me a while because I was experimenting with putting renderings in different CUDA streams. This turns out to be not worthwhile and doesn't give much performance gain.

@BachiLi BachiLi closed this as completed Dec 13, 2019
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

No branches or pull requests

2 participants