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

AttributeError: 'dict' object has no attribute 'clone' in SAC algorithm #263

Closed
scxzhchacker opened this issue Nov 19, 2023 · 2 comments
Closed

Comments

@scxzhchacker
Copy link

When I used the SAC algorithm with rl-games==1.6.1, the following error occurred

  File "/home/zhc/.local/share/ov/pkg/isaac_sim-2022.2.1/kit/python/lib/python3.7/site-packages/rl_games/algos_torch/sac_agent.py", line 497, in play_steps
    self.obs = next_obs.clone()
AttributeError: 'dict' object has no attribute 'clone'

Check the source code of the error section

            next_obs, rewards, dones, infos = self.env_step(action)
           
           # some  code
           
            if isinstance(next_obs, dict):    
                next_obs_processed = next_obs['obs']

            self.obs = next_obs.clone()

The next_obs returned by self.env_step(action) must be a dict after being packaged by the cast_obs function, but the error is reported when next_obs.clone() is called later.

@Denys88
Copy link
Owner

Denys88 commented Nov 22, 2023

hi, @scxzhchacker did you solve your problem?

@ViktorM
Copy link
Collaborator

ViktorM commented Nov 22, 2023

Hi @scxzhchacker I will push the fix later today.

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

3 participants