Comments (6)
Hello,
We have identified the cause of the issue, which is due to newer versions of numpy. At present, you can install a compatible version of numpy using the following command after installing LightZero: pip install numpy==1.22.4
.
I hope this resolves your problem. And we will work on compatibility with newer versions of numpy.
Best wishes.
from lightzero.
Hello,
Thank you very much for your interest.
- Did you install the latest version of LightZero by executing the following commands?
git clone https://github.com/opendilab/LightZero.git
cd LightZero
pip3 install -e .
-
We have been running the following command locally:
python -u zoo/board_games/tictactoe/config/tictactoe_muzero_sp_mode_config.py
and have not encountered any similar issues even with a large number of training steps. -
Can you specify if this error occurs after the program has been running for a while, or does it appear upon startup? Have you made any modifications to the related config or algorithms? If possible, could you provide more information? This would help us identify the problem and assist you better.
Best regards.
from lightzero.
Hello,
Thank you very much for your interest.
- Did you install the latest version of LightZero by executing the following commands?
git clone https://github.com/opendilab/LightZero.git cd LightZero pip3 install -e .
- We have been running the following command locally:
python -u zoo/board_games/tictactoe/config/tictactoe_muzero_sp_mode_config.py
and have not encountered any similar issues even with a large number of training steps.- Can you specify if this error occurs after the program has been running for a while, or does it appear upon startup? Have you made any modifications to the related config or algorithms? If possible, could you provide more information? This would help us identify the problem and assist you better.
Best regards.
This error occurred when the first simulation ended. The error messages are as follows:
Traceback (most recent call last):
File "/home/lyq/projects/LightZero/zoo/board_games/tictactoe/config/tictactoe_muzero_sp_mode_config.py", line 89, in
train_muzero([main_config, create_config], seed=0, max_env_step=max_env_step)
File "/home/lyq/projects/LightZero/lzero/entry/train_muzero.py", line 158, in train_muzero
new_data = collector.collect(train_iter=learner.train_iter, policy_kwargs=collect_kwargs)
File "/home/lyq/projects/LightZero/lzero/worker/muzero_collector.py", line 554, in collect
game_segments[env_id].game_segment_to_array()
File "/home/lyq/projects/LightZero/lzero/mcts/buffer/game_segment.py", line 250, in game_segment_to_array
self.child_visit_segment = np.array(self.child_visit_segment)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (7,) + inhomogeneous part.
It was found through debugging that the values of child_visit_segment
, when the error occurred, were as follows:
[[0.12, 0.12, 0.08, 0.08, 0.16, 0.12, 0.08, 0.08, 0.16],
[0.08, 0.16, 0.08, 0.08, 0.12, 0.24, 0.12, 0.12],
[0.2, 0.12, 0.08, 0.08, 0.24, 0.12, 0.16],
[0.2, 0.12, 0.12, 0.12, 0.16, 0.28],
[0.16, 0.4, 0.16, 0.16, 0.12],
[0.24, 0.2, 0.32, 0.24],
[0.32, 0.44, 0.24]]
Then np.array(self.child_visit_segment)
was run, and the error occurred.
from lightzero.
Hello,
We have identified the cause of the issue, which is due to newer versions of numpy. At present, you can install a compatible version of numpy using the following command after installing LightZero:
pip install numpy==1.22.4
.I hope this resolves your problem. And we will work on compatibility with newer versions of numpy.
Best wishes.
Hello,
This method solved my problem. Thank you so much!
Best wishes.
from lightzero.
Hi, i don't think this issue should be closed -- i've been seeing the same issues trying to use many of the built-in training scripts.
Installing numpy==1.22.4
addresses the problem, but that's not obvious following the installation instructions.
Either this numpy version should be pinned in requirements.txt
, or line 250 in mcts/buffer/game_segment.py
should be updated to read:
self.child_visit_segment = np.array(self.child_visit_segment, dtype=object)
from lightzero.
Hello, thank you for your insightful suggestions. We have updated the dependencies and relevant code for numpy on the main branch in this commit. If you have any other questions, please feel free to let us know. Best Wishes.
from lightzero.
Related Issues (20)
- Leaking illegal actions in SampledEfficientZero HOT 3
- Unrelated Records During EfficientZero in TensorBoard HOT 2
- Clang Issue - `pip install -e .` HOT 2
- Get a error when "pip install -e ." HOT 5
- Can't get mujoco example working on colab HOT 2
- requirement torch<=1.12.1,>=1.1.0 (from di-engine[common-env]) (from versions: 2.0.0, 2.0.1) HOT 1
- Lacking inference script HOT 4
- What is the easiest way to run experiments on colored Atari environments? HOT 1
- Errors on new install HOT 1
- A few questions about starting out and the Chess environment? HOT 3
- Training process gets killed due to OOM HOT 1
- Benefit of MCTS-based RL approaches over PPO, SAC, etc for dynamic robot HOT 1
- training not use GPU full perfermance , is just spikes HOT 2
- __emplace_back still causes compilation issues on m1 HOT 1
- Single Player AlphaZero HOT 3
- Upgrade to gymnasium HOT 2
- Can't install on fedora 38: package versions have conflicting dependencies HOT 5
- how to solve reward dropping after reaching super humain level HOT 9
- How to activate multi player with to_play and action_mask
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightzero.