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

Calling different tasks for different iteration #16

Closed
zyzhang1130 opened this issue Feb 3, 2020 · 2 comments
Closed

Calling different tasks for different iteration #16

zyzhang1130 opened this issue Feb 3, 2020 · 2 comments

Comments

@zyzhang1130
Copy link

Hi,
May I check if it is possible to define multiple tasks in tasks.py and call just one of them based on certain condition. If it is possible, how to do it ?
My guess is to modify rainbow_example.json script with a if-condition (I am using the rainbow algorithm to train the model). But since the task in that script is defined with a cell I'm not sure how exactly to implement that.

Thank you very much.

@beduffy
Copy link
Contributor

beduffy commented Feb 11, 2020

You will have to create a task with the same interface as PickUpTask in tasks.py and in the config dict/file which get's passed to
env = AI2ThorEnv(config_dict=config_dict)
will have to include:

'task': {
            'task_name': 'PickUpTask',
            'target_objects': {'Mug': 1, 'Bowl': 5}
        }

For different tasks in different episodes you will probably have to create a new environment.

@zyzhang1130
Copy link
Author

I tried to define a new config_dict immediately after
state, done = env.reset(), False (line 157, rainbow main.py)
(inside the if logic) and load it by
env = AI2ThorEnv(config_dict=config_dict)

and it threw me error at line
next_state, reward, done, _ = env.step(action) # Step (line 162)
saying:
AttributeError: 'NoneType' object has no attribute 'metadata'

May I know what's wrong with my modification? Thank you so much.

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