redner icon indicating copy to clipboard operation
redner copied to clipboard

Unable to visualize gradients

Open darthgera123 opened this issue 4 years ago • 1 comments

When im trying to run code given in test_screen_gradients.py im getting this error-

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-36-397484336d9f> in <module>
----> 1 screen_gradient_img = pyredner.RenderFunction.visualize_screen_gradient(
      2         grad_img = None,
      3     seed = 0,
      4     scene = scene,
      5     num_samples = 4,

~/anaconda3/envs/redner_cpu/lib/python3.8/site-packages/pyredner/render_pytorch.py in visualize_screen_gradient(grad_img, seed, scene, num_samples, max_bounces, channels, sampler_type, use_primary_edge_sampling, use_secondary_edge_sampling, sample_pixel_center)
   1013             channels = channels,
   1014             sample_pixel_center = sample_pixel_center)
-> 1015         args_ctx = RenderFunction.unpack_args(\
   1016             seed, args, use_primary_edge_sampling, use_secondary_edge_sampling)
   1017         channels = args_ctx.channels

~/anaconda3/envs/redner_cpu/lib/python3.8/site-packages/pyredner/render_pytorch.py in unpack_args(seed, args, use_primary_edge_sampling, use_secondary_edge_sampling)
    624             num_samples = (num_samples, num_samples)
    625 
--> 626         options = redner.RenderOptions(seed[0],
    627                                        num_samples[0],
    628                                        max_bounces,

TypeError: 'int' object is not subscriptable

darthgera123 avatar Sep 11 '20 12:09 darthgera123

Should be fixed in 0.4.27. I don't have my windows machine anymore (probably won't have one in the near future) so if you're using windows you'll need to manually install. Otherwise the new versions will be there in a few hours.

BachiLi avatar Sep 11 '20 13:09 BachiLi