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

Raise "ValueError" at "get_obj_color" function when I call "get_params_for_notebook(path)" for configuration in Colab #1

Open
62090500409 opened this issue Aug 28, 2023 · 0 comments

Comments

@62090500409
Copy link

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:

Screen Shot 2566-08-28 at 19 08 38

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'.

Screen Shot 2566-08-28 at 19 12 02

This check is contingent upon the dtype of the input, as indicated by the highlighted line in the image::

Screen Shot 2566-08-28 at 19 21 34

I noticed that you've set the dtype of Box as np.float32:

Screen Shot 2566-08-28 at 19 25 15

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.

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

1 participant