You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope this message finds you well. I wanted to reach out regarding the Colab Notebook you kindly provided. While attempting to run it, I encountered a ValueError that arises when calling get_params_for_notebook(path) in the configuration cell, as shown in the image below:
Upon closer inspection, I suspect that the issue may be stemming from the use of color_class.contain(rgb) and the default dtype of a floating pointnp.array. It appears that when the contains() method of the Color class is invoked, it in turn checks for the validity of rgb as a member ofgym.spaces.Box, which happens at the 82nd line in '/src/playground_env/color_generation.py'.
This check is contingent upon the dtype of the input, as indicated by the highlighted line in the image::
I noticed that you've set the dtype of Box as np.float32:
However, the dtype of rgb is np.float64. This might be due to the default dtype of a floating point np.array when it's created in the Colab environment. I'm unsure if the default floating-point dtype is different in other environments.
The crux of the issue appears to be that the contains() method will consistently return False because np.can_cast(np.float64, np.float32) evaluates to False.
My suggestion would be to consider either adjusting the dtype of Box to align with the default dtype of the environment or casting rgb to np.float32 before passing it to contains(). This might also apply to get_obj_shade().
Thank you very much for your attention to this matter. Your assistance in resolving this matter would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Hello,
I hope this message finds you well. I wanted to reach out regarding the Colab Notebook you kindly provided. While attempting to run it, I encountered a ValueError that arises when calling
get_params_for_notebook(path)
in the configuration cell, as shown in the image below:Upon closer inspection, I suspect that the issue may be stemming from the use of
color_class.contain(rgb)
and the default dtype of a floating pointnp.array
. It appears that when thecontains()
method of theColor
class is invoked, it in turn checks for the validity ofrgb
as a member ofgym.spaces.Box
, which happens at the 82nd line in '/src/playground_env/color_generation.py'.This check is contingent upon the dtype of the input, as indicated by the highlighted line in the image::
I noticed that you've set the dtype of
Box
asnp.float32
:However, the dtype of
rgb
isnp.float64
. This might be due to the default dtype of a floating pointnp.array
when it's created in the Colab environment. I'm unsure if the default floating-point dtype is different in other environments.The crux of the issue appears to be that the
contains()
method will consistently return False becausenp.can_cast(np.float64, np.float32)
evaluates to False.My suggestion would be to consider either adjusting the dtype of
Box
to align with the default dtype of the environment or castingrgb
tonp.float32
before passing it tocontains()
. This might also apply toget_obj_shade()
.Thank you very much for your attention to this matter. Your assistance in resolving this matter would be greatly appreciated.
The text was updated successfully, but these errors were encountered: