参考:https://github.com/FengQuanLi/ResnetGPT
下载项目
下载scrcpy 的windows版本,CV进项目文件夹
安装pyminitouch出现了问题,尝试用Anaconda和PyCharm可视化安装都说没有这个包
命令行解决:pip install pyminitouch
运行“启动和结束进程.py”后报错
参考:http://zuimeia.com/app/6771/?category=4&platform=2
应该是手机USB调试没打开
打开后可以投屏
改ID
改窗口名
参考:
https://zhidao.baidu.com/question/1449857090605578260.html
https://www.jianshu.com/p/f888390e37d5
https://blog.csdn.net/qq_41063141/article/details/84898289
没找到ID
换了台设备
找到了ID
但是报错
C:\Users\liyuanhang\anaconda3\python.exe C:/Users/liyuanhang/Desktop/AI王者荣耀/AI王者荣耀/ResnetGPT-master/训练数据截取_A.py
2021-02-06 10:40:41.247 | INFO | pyminitouch.utils:is_device_connected:56 - device G1 online
2021-02-06 10:40:41.247 | INFO | pyminitouch.connection:__init__:87 - searching a usable port ...
2021-02-06 10:40:43.249 | INFO | pyminitouch.connection:__init__:89 - device Y101191200497 bind to port 20843
2021-02-06 10:40:43.350 | INFO | pyminitouch.connection:get_abi:35 - device Y101191200497 is arm64-v8a
2021-02-06 10:40:43.536 | INFO | pyminitouch.connection:get_abi:35 - device Y101191200497 is arm64-v8a
2021-02-06 10:40:43.537 | INFO | pyminitouch.connection:download_target_mnt:41 - target minitouch url: https://github.com/williamfzc/stf-binaries/raw/master/node_modules/minitouch-prebuilt/prebuilt/arm64-v8a/bin/minitouch
C:\Users\LIYUAN~1\AppData\Local\Temp\tmpny_uqnlb: 1 file pushed, 0 skipped. 3.8 MB/s (34736 bytes in 0.009s)
2021-02-06 10:40:45.705 | INFO | pyminitouch.connection:download_target_mnt:51 - minitouch already installed in /data/local/tmp/minitouch
2021-02-06 10:40:45.707 | DEBUG | pyminitouch.connection:_forward_port:128 - forward command: adb -s Y101191200497 forward tcp:20843 localabstract:minitouch
2021-02-06 10:40:45.768 | DEBUG | pyminitouch.connection:_forward_port:130 - output: b'20843\r\n'
2021-02-06 10:40:45.768 | INFO | pyminitouch.connection:_start_mnt:141 - start minitouch: adb -s Y101191200497 shell /data/local/tmp/minitouch
Note: device /dev/input/mice is not supported by libevdev
Type A touch device gslX680 (1920x1200 with 256 contacts) detected on /dev/input/event3 (score 21517)
Note: hard-limiting maximum number of contacts to 10
Connection established
2021-02-06 10:40:46.775 | INFO | pyminitouch.connection:__init__:183 - minitouch running on port: 20843, pid: 32483
2021-02-06 10:40:46.776 | INFO | pyminitouch.connection:__init__:186 - max_contact: 10; max_x: 1920; max_y: 1200; max_pressure: 0
Downloading: "https://download.pytorch.org/models/resnet101-5d3b4d8f.pth" to C:\Users\liyuanhang/.cache\torch\hub\checkpoints\resnet101-5d3b4d8f.pth
100%|██████████| 170M/170M [00:37<00:00, 4.80MB/s]
Traceback (most recent call last):
File "C:/Users/liyuanhang/Desktop/AI王者荣耀/AI王者荣耀/ResnetGPT-master/训练数据截取_A.py", line 188, in <module>
mod = torchvision.models.resnet101(pretrained=True).eval().cuda(device).requires_grad_(False)
File "C:\Users\liyuanhang\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 463, in cuda
return self._apply(lambda t: t.cuda(device))
File "C:\Users\liyuanhang\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 359, in _apply
module._apply(fn)
File "C:\Users\liyuanhang\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 381, in _apply
param_applied = fn(param)
File "C:\Users\liyuanhang\anaconda3\lib\site-packages\torch\nn\modules\module.py", line 463, in <lambda>
return self._apply(lambda t: t.cuda(device))
RuntimeError: Invalid device, must be cuda device
意思是要cuda,也就是英伟达显卡,所以再换一台电脑
报错:OSError: [WinError 126] 找不到指定的模块。
Error loading "C:\ProgramData\Anaconda3\lib\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll" or one of its dependencies.
参考:
https://www.weixiuzhan.cn/news/show-20560.html
https://zhuanlan.zhihu.com/p/30802967
好家伙,之前也是这个问题
解决了
之后报错说我GPU不够
算了算了
用CPU吧
改了改代码,大概就是把cuda(device)改成cpu()之类的
改了的代码的链接在这
https://download.csdn.net/download/qq_39978434/18160305
能动
但是原主分辨率和我的不同,键位坐标全乱了,目前就方向键和攻击键改了我设备合适的坐标
留个坑以后再搞