Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

KeyError: 'Batch(): specified key: id or last_id not found!' #45

Closed
zhaojiayu opened this issue Aug 17, 2017 · 2 comments
Closed

KeyError: 'Batch(): specified key: id or last_id not found!' #45

zhaojiayu opened this issue Aug 17, 2017 · 2 comments

Comments

@zhaojiayu
Copy link

Hi,
When I ran demo, I met a problem :
log as follow :

Traceback (most recent call last):
  File "run.py", line 194, in <module>
    runner.run()
  File "/disk1/benjen/work-space/ELF/rlpytorch/trainer.py", line 179, in run
    self.GC.Run()
  File "/disk1/benjen/work-space/ELF/elf/utils_elf.py", line 258, in Run
    res = self._call(self.infos)
  File "/disk1/benjen/work-space/ELF/elf/utils_elf.py", line 249, in _call
    reply = self._cb[infos.gid](sel, sel_gpu)
  File "/disk1/benjen/work-space/ELF/rlpytorch/trainer.py", line 109, in actor
    self.stats.feed_batch(sel)
  File "/disk1/benjen/work-space/ELF/rlpytorch/stats.py", line 188, in feed_batch
    return self.collector.feed_batch(batch, hist_idx=hist_idx)
  File "/disk1/benjen/work-space/ELF/rlpytorch/stats.py", line 68, in feed_batch
    ids = batch["id"][hist_idx]
  File "/disk1/benjen/work-space/ELF/elf/utils_elf.py", line 88, in __getitem__
    raise KeyError("Batch(): specified key: %s or %s not found!" % (key, key_with_last))
KeyError: 'Batch(): specified key: id or last_id not found!'

my command is :

game=./rts/game_MC/game model=actor_critic model_file=./rts/game_MC/model python3 run.py --num_games 1024 --batchsize 128 --freq_update 50 --fs_opponent 20 --latest_start 500  --latest_start_decay 0.99 --opponent_type AI_SIMPLE --tqdm  --T 20   

the following is my environment:
os: ubuntu 16.04
nvidia driver version : 375.66
gcc version: 5.4.0

@yuandong-tian
Copy link
Contributor

try adding --additional_labels id,last_terminal in the command line.

@zhaojiayu
Copy link
Author

Thanks! That is a great tip.

teytaud pushed a commit that referenced this issue Nov 4, 2018
add instructions for analysis mode
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants