Equim-chan / Mortal

🚀🀄️ A fast and strong AI for riichi mahjong, powered by Rust and deep reinforcement learning.
https://mortal.ekyu.moe
GNU Affero General Public License v3.0
929 stars 118 forks source link

AssertionError: raw_count == S.buffer_size #41

Closed hyskylord closed 1 year ago

hyskylord commented 1 year ago

在online训练时server.py偶尔会出现这个错误,目前移除了这个assert来使用但是不明白为什么会产生这个错误。所有程序均在本地运行。

Equim-chan commented 1 year ago

这个看起来像是有别人在往 buffer_dir 里写东西。

hyskylord commented 1 year ago

调查了一下,似乎是因为repeat>1的时候server.py要覆写buffer里的文件,但是覆写的时候buffer_size也会增加。

Equim-chan commented 1 year ago

在我的用法里,capacity 是比较小的,所以一直没有碰到这种情况

hyskylord commented 1 year ago

只要capacity>train_play.games就会出现这个问题,可以设置两者的值相等来避免。或者可以微调一下生成的文件名(如加入timestamp)从而避免覆写发生。