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 FIX} fixed small positional argument bug #1231

Closed
wants to merge 1 commit into from

Conversation

Brunozml
Copy link
Contributor

problem: Jax implementation of DQN wouldn't work for buffer size >= 1000 (min buffer size for learning) because of small bug in line 282.

open_spiel/open_spiel/python/jax/dqn.py", line 282, in _loss max_next_q = jax.numpy.where( TypeError: where() got some positional-only arguments passed as keyword arguments: 'x, y' (.venv) brunozorrilla:.../GitHub/open_spiel$

Solution: get rid keyword of arguments:

    max_next_q = jax.numpy.where(
        1 - are_final_steps, max_next_q, jnp.zeros_like(max_next_q))

@lanctot
Copy link
Collaborator

lanctot commented May 22, 2024

Thanks!

@lanctot lanctot added imported This PR has been imported and awaiting internal review. Please avoid any more local changes, thanks! and removed imported This PR has been imported and awaiting internal review. Please avoid any more local changes, thanks! labels May 27, 2024
@lanctot
Copy link
Collaborator

lanctot commented May 27, 2024

Thanks @Brunozml for this.

I was running into an error when importing because it said the changes resulted in an empty import.

Turns out it was fixed recently internally: f33d30f

I guess your copy of master had not been updated yet. Thanks for spotting anyway!

@lanctot lanctot closed this May 27, 2024
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

Successfully merging this pull request may close these issues.

2 participants