Skip to content

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

@62090500409

Description

@62090500409

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions