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

Updating and debugging sequence_dataset() #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HesNobi
Copy link

@HesNobi HesNobi commented Jun 25, 2021

Hello,
Thank you very much for this open project and resources. I am researching Imitation and inverse reinforcement learning. D4RL has been a lifesaver.

The following code returns an error since some keys in the dataset arent np.ndarray or they don't present each step. I have fixed that by selecting the proper keys. Also to speed up the generator, I have added some limits on either the number of steps or episodes.

for k in dataset:
            data_[k].append(dataset[k][i])

I hope this pull request will be accepted
Thanks,

The 'sequence_dataset()' index error is fixed, And some steps and episode limits have been added to the generator.
@HesNobi HesNobi changed the title Update __init__.py Updating and debugging sequence_dataset() Jun 25, 2021
@jren03
Copy link

jren03 commented Feb 13, 2023

I seem to be erroring out on this line when I call d4rl.sequence_dataset(env) where env is any halfcheetah-medium-v2, hopper-medium-v2, or walker2d-medium-v2.

To reproduce:

d_iter = d4rl.sequence_dataset(env)
for traj in d_iter:
     pass
File "foo.py", line 111, in get_dataset
    for traj in d_iter:
File "/home/user/.conda/envs/d4rl/lib/python3.7/site-packages/d4rl/__init__.py", line 175, in sequence_dataset
    data_[k].append(dataset[k][i])
IndexError: invalid index to scalar variable.

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

Successfully merging this pull request may close these issues.

2 participants