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

Warnings in numpy >= 1.25 #454

Closed
carlosluis opened this issue Dec 4, 2023 · 1 comment
Closed

Warnings in numpy >= 1.25 #454

carlosluis opened this issue Dec 4, 2023 · 1 comment

Comments

@carlosluis
Copy link

Just FYI, as part of the migration / maintenance of MetaWorld, it might be important to take care of this numpy warning.

I've ran tests for all 50 metaworld envs for commit c822f28, and it occurs on dial-turn-v2, door-open-v2, hammer-v2 and lever-pull-v2.

Here's an example stack trace from one of my tests:

self = <metaworld.envs.mujoco.sawyer_xyz.v2.sawyer_lever_pull_v2.SawyerLeverPullEnvV2 object at 0x7f330a01ebe0>
obs = array([ 0.0058129 ,  0.39943335,  0.19429615,  1.        ,  0.14983521,
        0.58119154,  0.24981888,  0.66279996, ...      ,  0.        ,  0.        ,  0.        ,  0.        ,
        0.        ,  0.        ,  0.        ,  0.        ])
action = array([ 0.2889182 , -0.93614006, -0.69611247, -0.55025635])

    @_assert_task_is_set
    def evaluate_state(self, obs, action):
        (
            reward,
            shoulder_to_lever,
            ready_to_lift,
            lever_error,
            lever_engagement,
        ) = self.compute_reward(action, obs)
    
        info = {
>           "success": float(lever_error <= np.pi / 24),
            "near_object": float(shoulder_to_lever < 0.03),
            "grasp_success": float(ready_to_lift > 0.9),
            "grasp_reward": ready_to_lift,
            "in_place_reward": lever_engagement,
            "obj_to_target": shoulder_to_lever,
            "unscaled_reward": reward,
        }
E       DeprecationWarning: Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation. (Deprecated NumPy 1.25.)

../../anaconda3/envs/rlcore/lib/python3.9/site-packages/metaworld/envs/mujoco/sawyer_xyz/v2/sawyer_lever_pull_v2.py:79: DeprecationWarning

It's harmless for now (I think), but it might break the code after a future version of numpy

@reginald-mclean
Copy link
Collaborator

This should be fixed by #475

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