Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

AttributeError: can't set attribute #26

Open
Tonylin1998 opened this issue Jun 28, 2022 · 2 comments
Open

AttributeError: can't set attribute #26

Tonylin1998 opened this issue Jun 28, 2022 · 2 comments

Comments

@Tonylin1998
Copy link

Description

I was following docs, and when I tried to use command

PYTHONPATH=. python3 -u main.py \
setup=metaworld \
agent=state_sac \
env=metaworld-mt10 \
agent.multitask.num_envs=10 \
agent.multitask.should_use_disentangled_alpha=True

I kept getting AttributeError: can't set attribute error.

How to reproduce

PYTHONPATH=. python3 -u main.py \
setup=metaworld \
agent=state_sac \
env=metaworld-mt10 \
agent.multitask.num_envs=10 \
agent.multitask.should_use_disentangled_alpha=True

and the full error message is here

System information

  • MTRL Version : e282c3f commit
  • MTRL environment Name : metaworld-mt10
  • Python version : 3.7

Any other information

I use mujoco-py==2.0.2.0 and af8417bfc82a3e249b4b02156518d775f29eb289 commit for the MetaWorld environments, and I have also run through following two test codes to ensure my mujoco-py and metaworld was installed successfully.
mujoco-py test:

import mujoco_py
import os
mj_path, _ = mujoco_py.utils.discover_mujoco()
xml_path = os.path.join(mj_path, 'model', 'humanoid.xml')
model = mujoco_py.load_model_from_path(xml_path)
sim = mujoco_py.MjSim(model)

print(sim.data.qpos)

metaworld test:

import metaworld
import random

mt10 = metaworld.MT10() # Construct the benchmark, sampling tasks

training_envs = []
for name, env_cls in mt10.train_classes.items():
  env = env_cls()
  task = random.choice([task for task in mt10.train_tasks
                        if task.env_name == name])
  env.set_task(task)
  training_envs.append(env)

for env in training_envs:
  obs = env.reset()  # Reset environment
  a = env.action_space.sample()  # Sample an action
  obs, reward, done, info = env.step(a)  # Step the environoment with the sampled random action

Also, the full step I create my environment is here

@waterhorse1
Copy link

waterhorse1 commented Aug 15, 2022

@shagunsodhani I am facing the same problem, any solutions?

@shagunsodhani
Copy link
Contributor

This is likely an issue with the environment (metaworld) or gym. We fixed some of the environments in facebookresearch/mtenv#16 in MTEnv

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants