IrisRainbowNeko / genshin_auto_fish

基于深度强化学习的原神自动钓鱼AI
4.76k stars 725 forks source link

报错求助pywintypes.error: (0, 'SetCursorPos', 'No error message is available') #246

Closed peeeer closed 2 years ago

peeeer commented 2 years ago

运行后按r鼠标开始移动,切到游戏画面后不再做出动作,再切出来发现报错 F:\genshin_auto_fish-master>python fishing.py image -f yolox/exp/yolox_tiny_fish.py -c weights/best_tiny3.pth --conf 0.25 --nms 0.45 --tsize 640 --device gpu 2022-03-07 23:54:21.950 | INFO | main:main:91 - Args: Namespace(ckpt='weights/best_tiny3.pth', conf=0.25, demo='image', device='gpu', exp_file='yolox/exp/yolox_tiny_fish.py', experiment_name='yolox_tiny_fish', fp16=False, fuse=False, legacy=False, model_dir='./weights/fish_genshin_net.pth', n_actions=2, n_states=3, name=None, nms=0.45, path='./assets/dog.jpg', step_tick=12, trt=False, tsize=640) 2022-03-07 23:54:22.118 | INFO | main:main:101 - Model Summary: Params: 5.03M, Gflops: 15.15 2022-03-07 23:54:24.370 | INFO | main:main:114 - loading checkpoint 2022-03-07 23:54:24.559 | INFO | main:main:118 - loaded checkpoint done. INIT OK Waiting for "r" to perform fishing 2022-03-07 23:54:33.378 | INFO | fisher.predictor:inference:77 - Infer time: 1.0459s 2022-03-07 23:54:33.659 | INFO | fisher.predictor:inference:77 - Infer time: 0.0399s 2022-03-07 23:54:33.942 | INFO | fisher.predictor:inference:77 - Infer time: 0.0359s 2022-03-07 23:54:34.223 | INFO | fisher.predictor:inference:77 - Infer time: 0.0409s 2022-03-07 23:54:34.522 | INFO | fisher.predictor:inference:77 - Infer time: 0.0479s 2022-03-07 23:54:34.817 | INFO | fisher.predictor:inference:77 - Infer time: 0.0389s 2022-03-07 23:54:35.093 | INFO | fisher.predictor:inference:77 - Infer time: 0.0359s 2022-03-07 23:54:35.374 | INFO | fisher.predictor:inference:77 - Infer time: 0.0369s 2022-03-07 23:54:35.655 | INFO | fisher.predictor:inference:77 - Infer time: 0.0349s 2022-03-07 23:54:35.931 | INFO | fisher.predictor:inference:77 - Infer time: 0.0365s 2022-03-07 23:54:36.237 | INFO | fisher.predictor:inference:77 - Infer time: 0.0499s 2022-03-07 23:54:36.522 | INFO | fisher.predictor:inference:77 - Infer time: 0.0399s Traceback (most recent call last): File "fishing.py", line 215, in main(exp, args) File "fishing.py", line 153, in main start_fishing(predictor, agent) File "fishing.py", line 170, in start_fishing result: bool = ff.do_fish() File "F:\genshin_auto_fish-master\fisher\environment.py", line 180, in do_fish self.throw_rod(self.fish_list[0]) File "F:\genshin_auto_fish-master\fisher\environment.py", line 115, in throw_rod mouse_down(960, 540) File "F:\genshin_auto_fish-master\utils\utils.py", line 83, in mouse_down win32api.SetCursorPos((xx,yy)) pywintypes.error: (0, 'SetCursorPos', 'No error message is available')

peeeer commented 2 years ago

在游戏内按R没有反应

xinchenok commented 2 years ago

同问

IrisRainbowNeko commented 2 years ago

用管理员权限启动命令行窗口了吗

peeeer commented 2 years ago

是这个原因,已解决。谢谢。