GithubHelp home page GithubHelp logo

douzero_for_hlddz_fullauto's People

Contributors

girgle avatar moxiner avatar vincentzyx avatar xzpjerry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

douzero_for_hlddz_fullauto's Issues

地主牌有大小王会卡死

见下图,会卡在底牌现身的地方,不知道这个是不是所说的一定概率无法识别王炸的bug。
image

识别不了

总是识别不出地主和手牌,但是地主底牌可以,是哪里出了问题

连对 顺子 等多牌经常报错重置

下家 出牌 KKQQJJTT
运行时出现错误,已重置
ValueError("Coordinate 'lower' is less than 'upper'")
Traceback (most recent call last):
File "D:\Study\DouZero_For_HLDDZ_FullAuto\main.py", line 269, in init_cards
self.start()
File "D:\Study\DouZero_For_HLDDZ_FullAuto\main.py", line 525, in start
self.handle_others(self.RPlayedCardsPos, self.RPlayedCard, "下家")
File "D:\Study\DouZero_For_HLDDZ_FullAuto\main.py", line 391, in handle_others
self.waitUntilNoAnimation()
File "D:\Study\DouZero_For_HLDDZ_FullAuto\main.py", line 281, in waitUntilNoAnimation
ani = self.haveAnimation(ms)
File "D:\Study\DouZero_For_HLDDZ_FullAuto\main.py", line 759, in haveAnimation
if not self.compareImage(img.crop(region), lastImg.crop(region)):
File "D:\Programe\py310\lib\site-packages\PIL\Image.py", line 1206, in crop
raise ValueError("Coordinate 'lower' is less than 'upper'")
ValueError: Coordinate 'lower' is less than 'upper'

叫地主后闪退

叫牌预估得分: 0.772 不叫预估得分: 1.234
等待加倍或叫地主...地主牌: DXX22AAAAAKQQQQQJJJTT998877666554444433
Traceback (most recent call last):
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\main.py", line 437, in game_loop
self.before_start()
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\main.py", line 845, in before_start
win_rate = LandlordModel.predict_by_model(cards_str, llcards)
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\LandlordModel.py", line 112, in predict_by_model
action_message, show_action_list = pre_env.step("landlord")
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\douzero\env\game.py", line 156, in step
action, actions_confidence, action_list = self.players[1].act(self.game_infoset)
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\douzero\evaluation\deep_agent.py", line 44, in act
obs = get_obs(infoset, model_type=self.model_type)
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\douzero\env\env.py", line 193, in get_obs
return _get_obs_resnet(infoset, infoset.player_position)
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\douzero\env\env.py", line 598, in _get_obs_resnet
three_landlord_cards = _cards2array(infoset.three_landlord_cards)
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\douzero\env\env.py", line 228, in _cards2array
matrix[:, Card2Column[card]] = NumOnes2Array[num_times]
KeyError: 5

更该ADP模型

默认为ADP模型,但是训练好的模型路径是否是将_card_play_wp_model_path_中的WP改为ADP就可以

逻辑问题

遇到领取奖励和换对手按钮同时显示时(换对手按钮被领取奖励按钮遮罩)
会卡在点击换对手这一步

测试分辨率报错

截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。')
截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。')
截图时出现错误: error(1400, 'GetWindowRect', '无效的窗口句柄。')
Traceback (most recent call last):
File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\debug_screenshot.py", line 7, in
img = gh.DrawRectWithText(img, (313, 747, 1144, 200), "test")
File "H:\Code Files\Python\Pycharm\DouZero_For_HLDDZ_FullAuto\DouZero_For_HLDDZ_FullAuto-main\GameHelper.py", line 29, in DrawRectWithText
img = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
cv2.error: OpenCV(4.5.5) 👎 error: (-5:Bad argument) in function 'cvtColor'

Overload resolution failed:

  • src data type = 17 is not supported
  • Expected Ptrcv::UMat for argument 'src'

运行报错

运行时出现错误,已重置
KeyError(None)
Traceback (most recent call last):
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\main.py", line 269, in init_cards
self.start()
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\main.py", line 525, in start
self.handle_others(self.RPlayedCardsPos, self.RPlayedCard, "下家")
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\main.py", line 379, in handle_others
self.env.step(self.user_position, self.other_played_cards_env)
File "C:\Gametools\DouZero_For_HLDDZ_FullAuto-main\douzero\env\game.py", line 205, in step
self.played_cards[self.acting_player_position] += action
KeyError: None

截图时出现错误: error(5, 'SetActiveWindow', '拒绝访问。')

image
此页面一点击就报错退出
pygame 2.5.2 (SDL 2.28.3, Python 3.9.18)
Hello from the pygame community. https://www.pygame.org/contribute.html
landlord loads resnet model: baselines/resnet/resnet_landlord.ckpt
现在是自动模式
['-0.2', '-0.1', '0.0', '0.2', '0.1', '0.3', '0.2', '0.3', '0.2', '0.2', '0.1', '0.4']
截图时出现错误: error(5, 'SetActiveWindow', '拒绝访问。')
截图时出现错误: error(5, 'SetActiveWindow', '拒绝访问。')
截图时出现错误: error(5, 'SetActiveWindow', '拒绝访问。')

进程已结束,退出代码-1073740791 (0xC0000409)

运行后点击单局闪退/HLDDZ_FallAuto 拉起主程序失败

我调整了分辨率和缩放比,python环境不存在问题,也在开始游戏的界面点击单局,但是报错:
Process finished with exit code -1073740791 (0xC0000409)
注:我的欢乐斗地主在QQ游戏中心下载,版本 为最新版
尝试了:

  • 更改应用的高DPI缩放为系统:仍然报错。
  1. 在使用HLDDZ_FallAuto 配置指导最后一步拉起主程序时报错:
    (此时我在PyCharm中运行main.py是可以成功启动的,但是只要点击按钮就会闪退)
    bug
    报错显示PyQt启动应用程序时,未能将QT平台插件初始化。
    主要有三种可能的错误:
  1. 本人的解决方法:
  • 检查是否安装了PyQt5与PyQt5-tool
    cmd 输入pip install PyQt5pip install PyQt5-tool
    发现即使按照requirements.txt的环境安装,但是只会检查是否存在包,不会匹配包的版本,我的两个包的版本不匹配重新安装后解决。
    具体教程可以查看B站视频:https://www.bilibili.com/video/BV1Vq4y1X73o/?vd_source=87ef1f758d28f4e539342e3529e9de8c
  • 重新安装后,第一个问题解决,成功拉起主程序
    已经可以自动出牌了。问题解决。

追加bug
我本来以为一切正常,但是再次再PyCharm中运行main.py,有一行警告
DeprecationWarning: sipPyTypeDict() is deprecated, the extension module should use sipPyTypeDictRef() instead class MyPyQT_Form(QtWidgets.QWidget, Ui_Form):
看起来时程序结构的问题,此时UI界面一切正常,但是老毛病又发生了,我点击“单局”按键后闪退。
为此我重新装了pyqt5pyqt5-pluginspyqt5-tools,确保不存在多余的版本,且版本之间的相互依赖满足。
仍然无法通过运行main.py运行,但是在FallAuto中正常运行,不太明白发生了什么,但是能运行就好吧。

训练模型时报错

Cloning into 'Douzero_Cloud_Client'...
remote: Enumerating objects: 726, done.
remote: Counting objects: 100% (33/33), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 726 (delta 28), reused 27 (delta 27), pack-reused 693
Receiving objects: 100% (726/726), 37.45 MiB | 42.99 MiB/s, done.
Resolving deltas: 100% (420/420), done.
/content/Douzero_Cloud_Client/Douzero_Cloud_Client
Found log directory: douzero_checkpoints/douzero
Saving arguments to douzero_checkpoints/douzero/meta.json
Path to meta file already exists. Not overriding meta.
Saving messages to douzero_checkpoints/douzero/out.log
Path to message file already exists. New data will be appended.
Saving logs data to douzero_checkpoints/douzero/logs.csv
Saving logs' fields to douzero_checkpoints/douzero/fields.csv
Path to log file already exists. New data will be appended.
1
加载模型中,请稍后
初始化,正在获取服务器版本
获取模型版本失败: ConnectionError(MaxRetryError("HTTPConnectionPool(host='cf.vcccz.com', port=80): Max retries exceeded with url: /model_info (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f06fae4ffd0>: Failed to establish a new connection: [Errno -2] Name or service not known'))"))
服务器版本获取失败,更新模型失败
Traceback (most recent call last):
File "/content/Douzero_Cloud_Client/Douzero_Cloud_Client/train.py", line 8, in
train(flags)
File "/content/Douzero_Cloud_Client/Douzero_Cloud_Client/douzero/dmc/dmc.py", line 190, in train
models["cpu"].get_model(position).load_state_dict(torch.load("./models/" + position + ".ckpt", map_location="cpu"))
File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 791, in load
with _open_file_like(f, 'rb') as opened_file:
File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 271, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/usr/local/lib/python3.10/dist-packages/torch/serialization.py", line 252, in init
super().init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './models/landlord.ckpt'

出现炸弹或者飞机之类的牌后有几率会报错

出现这样的报错
然后就会重新运行

等待下家出牌
下家出牌: 22
等待上家出牌
上家出牌: 3333
File "D:\Project\Python\DouZero_For_HLDDZ_FullAuto-main\mian.py", line 759, in init_cards
self.game_start()
File "D:\Project\Python\DouZero_For_HLDDZ_FullAuto-main\mian.py", line 900, in game_start
action_message, action_list = self.env.step(self.user_position, update=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Project\Python\DouZero_For_HLDDZ_FullAuto-main\douzero\env\game.py", line 157, in step
action, actions_confidence, action_list = self.players[1].act(self.game_infoset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Project\Python\DouZero_For_HLDDZ_FullAuto-main\douzero\evaluation\deep_agent.py", line 43, in act
obs = get_obs(infoset, model_type=self.model_type)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Project\Python\DouZero_For_HLDDZ_FullAuto-main\douzero\env\env.py", line 200, in get_obs
return _get_obs_landlord_down(infoset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Project\Python\DouZero_For_HLDDZ_FullAuto-main\douzero\env\env.py", line 500, in _get_obs_landlord_down
landlord_played_cards = _cards2array(
^^^^^^^^^^^^^
File "D:\Project\Python\DouZero_For_HLDDZ_FullAuto-main\douzero\env\env.py", line 228, in _cards2array
matrix[:, Card2Column[card]] = NumOnes2Array[num_times]
~~~~~~~~~~~~~^^^^^^^^^^^
现在是手动模式,请手动出牌
未进入游戏

有时候抢到地主会卡住

如题。有时候抢到地主之后程序就卡住了,无法自动进行接下来的加倍出牌等后续操作。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.