glistering96 / AlphaRouter

2 stars 0 forks source link

np memory error #15

Closed glistering96 closed 1 year ago

glistering96 commented 1 year ago

Traceback (most recent call last): File "D:\PycharmProjects\AlphaRouter\debug_pretrain.py", line 99, in _work(**params) File "D:\PycharmProjects\AlphaRouter\debug_pretrain.py", line 33, in _work run_pretrain(args) File "D:\PycharmProjects\AlphaRouter\src\run.py", line 92, in run_pretrain

File "D:\PycharmProjects\AlphaRouter\src\pretrain_model\pretrainer_module.py", line 104, in run

File "D:\PycharmProjects\AlphaRouter\src\pretrain_model\pretrainer_module.py", line 183, in _train_one_epoch

File "D:\PycharmProjects\AlphaRouter\src\env\np_vec\tsp_np_vec_env.py", line 46, in reset self.xy = self._make_problems(self.num_env, self.num_nodes) File "D:\PycharmProjects\AlphaRouter\src\env\np_vec\tsp_np_vec_env.py", line 29, in _make_problems xy = make_cord(num_rollouts, 0, num_nodes) File "D:\PycharmProjects\AlphaRouter\src\common\data_manipulator.py", line 8, in make_cord node_cord = np.random.rand(num_rollouts, num_nodes, 2).astype(np.float32) File "mtrand.pyx", line 1202, in numpy.random.mtrand.RandomState.rand File "mtrand.pyx", line 436, in numpy.random.mtrand.RandomState.random_sample File "_common.pyx", line 307, in numpy.random._common.double_fill numpy.core._exceptions._ArrayMemoryError: Unable to allocate 1.56 MiB for an array with shape (1024, 100, 2) and data type float64

It seems to occur as numpy uses f.64 as default type.

glistering96 commented 1 year ago

Closing the issue as it is handled in commit 26ac649a19cf664784e99d1c22086c08197e1f90