vincentzyx / douzero_for_hlddz_fullauto Goto Github PK
View Code? Open in Web Editor NEW将DouZero用于欢乐斗地主自动化
License: Apache License 2.0
将DouZero用于欢乐斗地主自动化
License: Apache License 2.0
进程已结束,退出代码-1073740791 (0xC0000409)
缩放比不为100%时,显示不完整
总是识别不出地主和手牌,但是地主底牌可以,是哪里出了问题
下家 出牌 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'
导出的requrements.txt能不能带上版本号啊, 这**python的包兼容性你又不是不知道...
自动模式下,把把都抢地主,而且每次都超级加倍且明牌,这个是AI通过胜率计算出来的?还是可以通过配置文件配置的...
叫牌预估得分: 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模型,但是训练好的模型路径是否是将_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'
我猜是 main.py
运行时出现错误,已重置
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
先使用 debug_screenshot.py 确认自己的屏幕缩放比
请问缩放比是什么 修改哪里?
此页面一点击就报错退出
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)
我调整了分辨率和缩放比,python环境不存在问题,也在开始游戏的界面点击单局,但是报错:
Process finished with exit code -1073740791 (0xC0000409)
注:我的欢乐斗地主在QQ游戏中心下载,版本 为最新版
尝试了:
pip install PyQt5
和pip install PyQt5-tool
追加bug
我本来以为一切正常,但是再次再PyCharm中运行main.py,有一行警告
DeprecationWarning: sipPyTypeDict() is deprecated, the extension module should use sipPyTypeDictRef() instead class MyPyQT_Form(QtWidgets.QWidget, Ui_Form):
看起来时程序结构的问题,此时UI界面一切正常,但是老毛病又发生了,我点击“单局”按键后闪退。
为此我重新装了pyqt5
,pyqt5-plugins
,pyqt5-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]
~~~~~~~~~~~~~^^^^^^^^^^^
现在是手动模式,请手动出牌
未进入游戏
如题。有时候抢到地主之后程序就卡住了,无法自动进行接下来的加倍出牌等后续操作。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.