linyiLYi / street-fighter-ai

This is an AI agent for Street Fighter II Champion Edition.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

yesheng98 opened this issue · comments

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

请问如何解决内存不够

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