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

TypeError: list indices must be integers or slices, not str #56

Open
GeorgeDUT opened this issue Jan 29, 2021 · 1 comment
Open

TypeError: list indices must be integers or slices, not str #56

GeorgeDUT opened this issue Jan 29, 2021 · 1 comment

Comments

@GeorgeDUT
Copy link

GeorgeDUT commented Jan 29, 2021

I run:
python train.py --config configs/maml/bandit/bandit-k5-n10.yaml --output-folder bandit/bandit-k5-n10/ --seed 1 --num-workers 8
but fail:
Process SamplerWorker-1:
Process SamplerWorker-2:
Process SamplerWorker-3:
Traceback (most recent call last):
Traceback (most recent call last):
File "/gpfs/share/home/.conda/envs/spinningup/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 333, in run
self.sample(index, **kwargs)
File "/gpfs/share/home/.conda/envs/spinningup/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 263, in sample
device=device)
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 333, in run
self.sample(index, **kwargs)
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 298, in create_episodes
for item in self.sample_trajectories(params=params):
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 263, in sample
device=device)
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 318, in sample_trajectories
batch_ids = infos['batch_ids']
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 298, in create_episodes
for item in self.sample_trajectories(params=params):
File "/gpfs/share/home/MetaRLSAS/maml_rl/samplers/multi_task_sampler.py", line 318, in sample_trajectories
batch_ids = infos['batch_ids']
TypeError: list indices must be integers or slices, not str
TypeError: list indices must be integers or slices, not str

what's wrong with this?

@tristandeleu
Copy link
Owner

I am not able to reproduce this error. The script is running on my end with the command you give, with the latest version of the code. Did you change anything in the code, or are you running it straight from master? This error should not happen, because infos is not a list but a dict

return (observations, rewards, np.copy(self._dones),
{'batch_ids': batch_ids, 'infos': infos})

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

2 participants