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

meet error when run the command "luxai-s3 main.py main.py --output=replay.html" #50

Open
plantonic opened this issue Jan 3, 2025 · 4 comments

Comments

@plantonic
Copy link

The error message below was shown when I try to run two simple agent to test the installation of the code. Anyone met similar problems?

(venv) PS D:\study\Kaggle-Lux-AI-s3\kits\python> luxai-s3 main.py main.py --output=replay.html player_0, main.py: Traceback (most recent call last): player_0, main.py:   File "D:\study\Kaggle-Lux-AI-s3\kits\python\main.py", line 6, in player_0, main.py:     import numpy as np player_0, main.py: ModuleNotFoundError: No module named 'numpy' player_1, main.py: Traceback (most recent call last): player_1, main.py:   File "D:\study\Kaggle-Lux-AI-s3\kits\python\main.py", line 6, in player_1, main.py:     import numpy as np player_1, main.py: ModuleNotFoundError: No module named 'numpy' player_0, main.py: cannot parse action '' player_1, main.py: cannot parse action '' Traceback (most recent call last):   File "D:\study\Kaggle-Lux-AI-s3\venv\Lib\site-packages\jax_src\pjit.py", line 616, in _infer_params_impl     avals.append(shaped_abstractify(a))                  ^^^^^^^^^^^^^^^^^^^^^   File "D:\study\Kaggle-Lux-AI-s3\venv\Lib\site-packages\jax_src\api_util.py", line 606, in shaped_abstractify     return handler(x) if handler is not None else _shaped_abstractify_slow(x)            ^^^^^^^^^^   File "D:\study\Kaggle-Lux-AI-s3\venv\Lib\site-packages\jax_src\api_util.py", line 617, in _numpy_array_abstractify     dtypes.check_valid_dtype(dtype)   File "D:\study\Kaggle-Lux-AI-s3\venv\Lib\site-packages\jax_src\dtypes.py", line 739, in check_valid_dtype     raise TypeError(f"Dtype {dtype} is not a valid JAX array " TypeError: Dtype object is not a valid JAX array type. Only arrays of numeric types are supported by JAX.   The above exception was the direct cause of the following exception:   Traceback (most recent call last):   File "D:\study\Kaggle-Lux-AI-s3\venv\Scripts\luxai-s3-script.py", line 33, in     sys.exit(load_entry_point('luxai-s3', 'console_scripts', 'luxai-s3')())              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "d:\study\kaggle-lux-ai-s3\src\luxai_runner\cli.py", line 129, in main     results = asyncio.run(eps.run())     return self._loop.run_until_complete(task)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   File "D:\apps\python3.11\Lib\asyncio\base_events.py", line 653, in run_until_complete     return future.result()            ^^^^^^^^^^^^^^^   File "d:\study\kaggle-lux-ai-s3\src\luxai_runner\episode.py", line 174, in run     new_state_obs, rewards, terminations, truncations, infos = self.env.step(                                                                ^^^^^^^^^^^^^^   File "d:\study\kaggle-lux-ai-s3\src\luxai_s3\wrappers.py", line 137, in step     obs, reward, terminated, truncated, info = self.env.step(action)                                                ^^^^^^^^^^^^^^^^^^^^^   File "d:\study\kaggle-lux-ai-s3\src\luxai_s3\wrappers.py", line 87, in step     obs, self.state, reward, terminated, truncated, info = self.jax_env.step(                                                            ^^^^^^^^^^^^^^^^^^ TypeError: Error interpreting argument to <function LuxAIS3Env.step at 0x000001AAF7F7DA80> as an abstract array. The problematic value is of type <class 'numpy.ndarray'> and was passed to the function at path action['player_0']. This typically means that a jit-wrapped function was called with a non-array argument, and this argument was not marked as static using the static_argnums or static_argnames parameters of jax.jit.     -------------------- For simplicity, JAX has removed its internal frames from the traceback of the following exception. Set JAX_TRACEBACK_FILTERING=off to include these.

@RonnyGN
Copy link

RonnyGN commented Jan 17, 2025

Yes, the same exact issue has occured with me too. I have struck a huge wall and I don't know what to do next.

@StoneT2000
Copy link
Member

It looks like you don't have numpy installed? how did you install the environment.

@AbdiHaryadi
Copy link

I think luxai-s3 doesn't support virtual environment dependencies. I have to install numpy outside of it to solve this problem.

@KirillTushin
Copy link

What helps me:
Pass the path to the virtual environment before starting the program:

export PYTHONPATH=$(python -c "import sys; print(':'.join(sys.path))")

For windows:

$env:PYTHONPATH = (python -c "import sys; print(';'.join(sys.path))")

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

5 participants