MahjongCopilot icon indicating copy to clipboard operation
MahjongCopilot copied to clipboard

程序正常运行但是无法产生ai提示

Open l68728 opened this issue 1 year ago • 4 comments

main.py程序能跑通 使用了本地模型local mortal.pth,进入对局后无法显示ai提示。 系统macOS14.6.1 代码如下

2024-09-05 00:06:07,202 ERROR [BotThread]game_state.py:610 | Bot react error: failed to get reaction

Caused by:
    0: failed to execute `react_batch` on Python engine
    1: RuntimeError: Could not infer dtype of numpy.float32
Traceback (most recent call last):
  File "/Users/s/Downloads/aa/game/game_state.py", line 608, in _react_all
    output_reaction = self.mjai_bot.react_batch(self.mjai_pending_input_msgs)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/s/Downloads/aa/bot/bot.py", line 74, in react_batch
    last_reaction = self.react(input_list[-1])
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/s/Downloads/aa/bot/bot.py", line 125, in react
    react_str = self.mjai_bot.react(str_input)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: failed to get reaction

Caused by:
    0: failed to execute `react_batch` on Python engine
    1: RuntimeError: Could not infer dtype of numpy.float32

或者是否能打包一个mac版本的客户端?

l68728 avatar Sep 04 '24 16:09 l68728

This issue may be caused by the torch version is incompatible with the numpy version. Please use the pip or other tools to downgrade numpy to a version below 2.0

anonymized123 avatar Dec 02 '24 10:12 anonymized123

我将numpy降级至1.26.4已解决,如[anonymized123]所说降级至2.0版本以下应该皆可。

Mr-EEEeee avatar Dec 19 '24 18:12 Mr-EEEeee

我将numpy降级至1.26.4已解决,如[anonymized123]所说降级至2.0版本以下应该皆可。

+1

xushaowu avatar Dec 26 '24 16:12 xushaowu

有没有大佬能教一下怎么才能打包成app,现在我每次都是在terminal运行代码,然后输密码签中间人证书

aaasd2 avatar Jun 23 '25 10:06 aaasd2