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.

TypeError: tuple indices must be integers or slices, not str

See original GitHub issue

Hi, I have a little problem. when I run

python3 -m scripts.train --algo ppo --env MiniGrid-DoorKey-5x5-v0 --model DoorKey --save-interval 10 --frames 80000

It goes like

        image": preprocess_images([obs["image"] for obs in obss], device=device),
TypeError: tuple indices must be integers or slices, not str

which happened here:

        def preprocess_obss(obss, device=None):
            return torch_ac.DictList({
                "image": preprocess_images([obs["image"] for obs in obss], device=device),
                "text": preprocess_texts([obs["mission"] for obs in obss], vocab, device=device)
            })
        preprocess_obss.vocab = vocab

How should I fix it? Thx

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
salemlcommented, Sep 30, 2022

I’ll look into this today

0reactions
lcswillemscommented, Sep 29, 2022

@saleml Should rl-starter-files be modified to work with the new version of gym-minigrid?

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: tuple indices must be integers, not str
I am trying to pull data from a database and assign them to different lists. This specific error is giving me a lot...
Read more >
TypeError: tuple indices must be integers or slices, not str
The Python "TypeError: tuple indices must be integers or slices, not str" occurs when we use a string instead of an integer to...
Read more >
Python pandas TypeError tuple indices must be integers or ...
df.iterrows() returns a tuple with index and the row value. ... TypeError: list indices must be integers or slices, not str.
Read more >
TypeError: tuple indices must be integers, not str - Codecademy
TypeError : tuple indices must be integers, not str ... they are considered tuples, tuples are like lists except immutable (can't be changed...
Read more >
TypeError: tuple indices must be integers or slices, not str ...
The typeerror: tuple indices must be integers or slices, not str error comes when you can't get row information using row["pool_number"].
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