minerl icon indicating copy to clipboard operation
minerl copied to clipboard

BufferedBatchIter fails when buffer_target_size=10000

Open alper111 opened this issue 4 years ago • 1 comments

Steps to reproduce:

import minerl
from minerl.data import BufferedBatchIter

data = minerl.data.make('MineRLObtainDiamondDenseVectorObf-v0')
iterator = BufferedBatchIter(data, buffer_target_size=10000)

count = 0
for (s, a, r, sn, d) in iterator.buffered_batch_iter(batch_size=32, num_epochs=1):
        # ... do something with the data.
        count += len(r)
        print(count)

print("epoch finished %d" % count)

Expected behavior:

The loop should finish successfully.

Observed behavior:

Traceback (most recent call last):
  File "/home/***/workspace/golem/sampler.py", line 8, in <module>
    for (s, a, r, sn, d) in iterator.buffered_batch_iter(batch_size=32, num_epochs=1):
  File "/home/***/miniconda3/envs/minerl/lib/python3.9/site-packages/minerl/data/buffered_batch_iter.py", line 119, in buffered_batch_iter
    assert len(self.available_trajectories) == 0, "You've reached the end of your " \
AssertionError: You've reached the end of your data buffer while still having trajectories available; something seems to have gone wrong

alper111 avatar Jul 17 '21 08:07 alper111

Pinging @decodyng if she would like to take a look at this. I am quickly passing by and will delve deeper into this next week.

Miffyli avatar Jul 17 '21 10:07 Miffyli