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

Bug for version 1.7.3: 'str' object has no attribute 'action' #121

Open
titoeb opened this issue Dec 19, 2020 · 0 comments
Open

Bug for version 1.7.3: 'str' object has no attribute 'action' #121

titoeb opened this issue Dec 19, 2020 · 0 comments

Comments

@titoeb
Copy link

titoeb commented Dec 19, 2020

With version 1.7.3 installed via pip the following code

from kaggle_environments import make, evaluate
import random

def random_agent(obs, conf):
    return random.randrange(conf.banditCount)

env = make("mab", debug=True)
env.run([random_agent, random_agent])
res = env.render(mode="ansi")

leads to a str' object has no attribute 'action'-error.

There are two options to fix the problem.
Either change in core.py line 279 to args = [self.steps, self] (don't know how that would interact for the other environments)
or use env.steps[i] in line 135 of mab.py. I will create a PR with the latter option, although I think the first option, if done correctly would lead to a better implementation. Also interesting, that the argument of the renderer function is called steps but effectively gets the env.state object.

@titoeb titoeb changed the title Bug: for version 1.7.3 Bug for version 1.7.3: 'str' object has no attribute 'action' Dec 19, 2020
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

1 participant