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

numpy.core._exceptions.MemoryError: Unable to allocate 1.17 GiB for an array with shape (512, 16, 3, 100, 128) and data type float32 #57

Open
yesheng98 opened this issue May 8, 2023 · 1 comment

Comments

@yesheng98
Copy link

Using cpu device
Wrapping the env in a VecTransposeImage.
(3, 100, 128)
Traceback (most recent call last):
File "G:/强化学习/street-fighter-ai/main/train.py", line 128, in
main()
File "G:/强化学习/street-fighter-ai/main/train.py", line 115, in main
model.learn(
File "E:\Anaconda\envs\StreetFighterAI\lib\site-packages\stable_baselines3\ppo\ppo.py", line 307, in learn
return super().learn(
File "E:\Anaconda\envs\StreetFighterAI\lib\site-packages\stable_baselines3\common\on_policy_algorithm.py", line 248, in learn
continue_training = self.collect_rollouts(self.env, callback, self.rollout_buffer, n_rollout_steps=self.n_steps)
File "E:\Anaconda\envs\StreetFighterAI\lib\site-packages\stable_baselines3\common\on_policy_algorithm.py", line 151, in collect_rollouts
rollout_buffer.reset()
File "E:\Anaconda\envs\StreetFighterAI\lib\site-packages\stable_baselines3\common\buffers.py", line 360, in reset
self.observations = np.zeros((self.buffer_size, self.n_envs) + self.obs_shape, dtype=np.float32)
numpy.core._exceptions.MemoryError: Unable to allocate 1.17 GiB for an array with shape (512, 16, 3, 100, 128) and data type float32

请问如何解决内存不够

@lang07123
Copy link

再买个内存 或者 减小train.py中模拟器数量

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

2 participants