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

A minor issue when training models with maze2d dataset #8

Closed
zanghyu opened this issue Jul 6, 2022 · 6 comments
Closed

A minor issue when training models with maze2d dataset #8

zanghyu opened this issue Jul 6, 2022 · 6 comments

Comments

@zanghyu
Copy link

zanghyu commented Jul 6, 2022

Hi,

Thanks for sharing the nice code! There was a minor issue when I trained the model with the script python scripts/train.py --dataset maze2d-umaze-v1 --horizon 512 --n_diffusion_steps 200:

File ".../diffuser/datasets/buffer.py", line 75, in add_path
    self._dict[key][self._count, :path_length] = array
IndexError: index 10000 is out of bounds for axis 0 with size 10000

and I believe the episode number of the maze2d dataset is more than 10000, which caused this error. So I set max_n_episodes=20000 at the line: https://github.com/jannerm/diffuser/blob/main/diffuser/datasets/sequence.py#L18. And it really fixed this issue. Maybe you can update the corresponding code if I'm correct?

BTW, looking forward to seeing your testing/evaluating code :)

@yilundu
Copy link
Collaborator

yilundu commented Jul 29, 2022

Hi the maze2d code should be released now -- do you still have issues?

@zanghyu
Copy link
Author

zanghyu commented Aug 1, 2022

Thanks for the reply! But it seems the error still occurs...

@jannerm
Copy link
Owner

jannerm commented Aug 1, 2022

Thanks for reporting. Could you check that you're on the maze2d branch and using the default maze2d config?

git checkout maze2d
python scripts/train.py --config config.maze2d --dataset maze2d-large-v1

If that doesn't solve it, could you send the full stack trace?

@zanghyu
Copy link
Author

zanghyu commented Aug 1, 2022

Here's the stack trace:

Traceback (most recent call last):
  File "scripts/train.py", line 36, in <module>
    dataset = dataset_config()
  File "/data/hyzang/project/rl/representation/diffuser-main/maze2d/diffuser-maze2d/diffuser/utils/config.py", line 65, in __call__
    instance = self._class(*args, **kwargs, **self._dict)
  File "/data/hyzang/project/rl/representation/diffuser-main/maze2d/diffuser-maze2d/diffuser/datasets/sequence.py", line 28, in __init__
    fields.add_path(episode)
  File "/data/hyzang/project/rl/representation/diffuser-main/maze2d/diffuser-maze2d/diffuser/datasets/buffer.py", line 75, in add_path
    self._dict[key][self._count, :path_length] = array
IndexError: index 10000 is out of bounds for axis 0 with size 10000

The default setting of the max_n_episodes being small could still be the issue?

@jannerm
Copy link
Owner

jannerm commented Aug 1, 2022

Could you include everything printed up until that point by the script? I think you're right that the max_n_episodes is what's causing the error locally, but I'm trying to figure out why you're getting the error when I don't, and looking at the printed configs might help me figure that out.

@zanghyu
Copy link
Author

zanghyu commented Aug 6, 2022

Sorry for the late reply, I have re-run the code today, and found it works! Thanks very much!

@zanghyu zanghyu closed this as completed Aug 6, 2022
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