question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replayloader doesn't work for Atari

See original GitHub issue

Have you tried using this replay loader with Atari? I keep getting this error unless I set the num replay workers to 1:

File "/u/slerman/miniconda3/envs/agi/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/u/slerman/miniconda3/envs/agi/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 28, in fetch
    data.append(next(self.dataset_iter))
  File "/home/cxu-serve/u1/slerman/drqv2/replay_buffer.py", line 176, in __iter__
    yield self._sample()
  File "/home/cxu-serve/u1/slerman/drqv2/replay_buffer.py", line 159, in _sample
    episode = self._sample_episode()
  File "/home/cxu-serve/u1/slerman/drqv2/replay_buffer.py", line 99, in _sample_episode
    eps_fn = random.choice(self._episode_fns)
  File "/u/slerman/miniconda3/envs/agi/lib/python3.8/random.py", line 290, in choice
    raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence


Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

Edit: Sorry, originally posted the wrong trace.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
denisyaratscommented, Oct 19, 2021

Hi, I think before starting sampling from the replay buffer you need to have at least N episodes to be stored in the replay buffer, where N is the number of workers. Otherwise some of the workers end up with no data to sample from and throw this error.

So make sure to modify your code in such a way that you already have enough data collected.

0reactions
slerman12commented, Nov 16, 2021

Hi, did you ever get a chance to look at this code?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug Report] Atari envs rendering doesn't work #2656 - GitHub
Hey, I'm able to render Box2d envs, but when I tried some Atari games I encountered consistantly the following error: ImportError: cannot ......
Read more >
Atari 5200 Troubleshooting - iFixit
This Troubleshooting Guide will help users dissect their Atari 5200 System, controller, and/or cartridge so that they can properly repair them.
Read more >
Home – Atari®
Discover classic consoles and cartridges, modern titles and never-before-seen art and gameplay from Atari.
Read more >
Contact us – Atari®
Atari Customer Service is available to help with orders, games, downloads and questions about products and services.
Read more >
The 103 classic games that did, and didn't, make the Atari 50 ...
Atari 7800. Asteroids; Basketbrawl; Centipede; Dark Chambers; Fatal Run; Ninja Golf; Scrapyard Dog. The closest we get to "unreleased" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found