hypernerf icon indicating copy to clipboard operation
hypernerf copied to clipboard

TypeError: broadcast_to requires ndarray or scalar arguments, got <class 'list'> at position 0.

Open ankitatiisc opened this issue 2 years ago • 1 comments

Hi authors I am getting this error while running train.py script. I have not made any changes to the code. If I may ask, what was your build setup and configuration ? Also, is this code specific only for a jax version or does it have a forward compatibility with new version of jax. ?

ankitatiisc avatar Jul 09 '22 19:07 ankitatiisc

Modifying: https://github.com/google/hypernerf/blob/main/hypernerf/model_utils.py#L114

From:

jnp.broadcast_to([last_sample_z], z_vals[..., :1].shape)

To:

import numpy as np ... jnp.broadcast_to(np.asarray([last_sample_z]), z_vals[..., :1].shape)

Fixed the problem for me. (jax version fixed to jax==0.2.20 jaxlib==0.1.71)

dctisdale avatar Mar 22 '23 21:03 dctisdale