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

JAX error: RuntimeError: optional has no value #13

Closed
mengdong opened this issue Mar 25, 2021 · 4 comments
Closed

JAX error: RuntimeError: optional has no value #13

mengdong opened this issue Mar 25, 2021 · 4 comments

Comments

@mengdong
Copy link

When Parse data in https://github.com/google/nerfies/blob/main/notebooks/Nerfies_Capture_Processing.ipynb

executing following cell:

if colmap_image_scale > 1:
  print(f'Scaling COLMAP cameras back to 1x from {colmap_image_scale}x.')
  for item_id in scene_manager.image_ids:
    camera = scene_manager.camera_dict[item_id]
    scene_manager.camera_dict[item_id] = camera.scale(colmap_image_scale)

Run into error below, seems to be a JAX error, how should we address this? Thanks

Scaling COLMAP cameras back to 1x from 4x.
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-24-32db5f4d2f95> in <module>
     11   for item_id in scene_manager.image_ids:
     12     camera = scene_manager.camera_dict[item_id]
---> 13     scene_manager.camera_dict[item_id] = camera.scale(colmap_image_scale)
     14 
     15 

/usr/local/lib/python3.8/dist-packages/nerfies/camera.py in scale(self, scale)
    315         radial_distortion=self.radial_distortion.copy(),
    316         tangential_distortion=self.tangential_distortion.copy(),
--> 317         image_size=jnp.array((int(round(self.image_size[0] * scale)),
    318                               int(round(self.image_size[1] * scale)))),
    319     )

/usr/local/lib/python3.8/dist-packages/jax/_src/numpy/lax_numpy.py in array(object, dtype, copy, order, ndmin)
   2903     _inferred_dtype = object.dtype and dtypes.canonicalize_dtype(object.dtype)
   2904     lax._check_user_dtype_supported(_inferred_dtype, "array")
-> 2905     out = _device_put_raw(object, weak_type=weak_type)
   2906     if dtype: assert _dtype(out) == dtype
   2907   elif isinstance(object, (DeviceArray, core.Tracer)):

/usr/local/lib/python3.8/dist-packages/jax/_src/lax/lax.py in _device_put_raw(x, weak_type)
   1493   else:
   1494     aval = raise_to_shaped(core.get_aval(x), weak_type=weak_type)
-> 1495     return xla.array_result_handler(None, aval)(*xla.device_put(x))
   1496 
   1497 def iota(dtype: DType, size: int) -> Array:

/usr/local/lib/python3.8/dist-packages/jax/interpreters/xla.py in make_device_array(aval, device, device_buffer)
   1032   if (isinstance(device_buffer, _CppDeviceArray)):
   1033 
-> 1034     if device_buffer.aval == aval and device_buffer._device == device:
   1035       return device_buffer
   1036     device_buffer = device_buffer.clone()

RuntimeError: optional has no value
@mengdong
Copy link
Author

it is a jax issue, fixed.

@Carinazhao22
Copy link

Hi, I got a similar issue. How can you fix it? thanks

@mengdong
Copy link
Author

Hi please install latest JAX : pip install --upgrade jax jaxlib==0.1.64+cuda110 -f https://storage.googleapis.com/jax-releases/jax_releases.html

@Carinazhao22
Copy link

it works. thanks

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