prinsphield / wechat_autojump Goto Github PK
View Code? Open in Web Editor NEWAI plays WeChat Jump Game
Home Page: https://zhuanlan.zhihu.com/p/32636329
License: MIT License
AI plays WeChat Jump Game
Home Page: https://zhuanlan.zhihu.com/p/32636329
License: MIT License
Wechat_AutoJump$ python play.py --phone Android --sensitivity 2.045
1674 KB/s (223267 bytes in 0.130s)
Traceback (most recent call last):
File "play.py", line 174, in
AI.run()
File "play.py", line 159, in run
self.play()
File "play.py", line 145, in play
self.target_pos = self.get_target_position_fast(self.state, self.player_pos)
File "play.py", line 111, in get_target_position_fast
b1, b2 = cv2.connectedComponents(m)
AttributeError: 'module' object has no attribute 'connectedComponents'
import wda 是需要pip 吗?但是我pip install wda没有找到。
python2.7,win7
adb是从网上下得的adb(http://www.skycn.net/soft/appid/24272.html)
opencv应该也正确安装,并在调试中正确显示图片。
在运行python play.py --phone Android --sensitivity 2.045时,结果如下:
C:\Users\donglan01\Desktop\tiaoyitiao\Wechat_AutoJump-master>python play.py --phone Android --sensitivity 2.045
2289 KB/s (42206 bytes in 0.018s)
Traceback (most recent call last):
File "play.py", line 175, in
AI.run()
File "play.py", line 160, in run
self.play()
File "play.py", line 146, in play
self.target_pos = self.get_target_position_fast(self.state, self.player_pos)
File "play.py", line 111, in get_target_position_fast
b1, b2 = cv2.connectedComponents(m)
AttributeError: 'module' object has no attribute 'connectedComponents'
希望可以检测游戏失败
然后提供个参数选择无限重刷或失败则停止
感谢作者提供了非常棒的代码!十分感谢!
但是我的手机跳得很不准啊!请问该如何解决?谢谢!
Traceback (most recent call last):
File "play.py", line 161, in
AI = WechatAutoJump(args.phone, args.sensitivity, args.debug, args.resource)
File "play.py", line 45, in init
self.client = wda.Client()
NameError: name 'wda' is not defined
OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in cv::resi
ze, file C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\imgpr
oc\src\resize.cpp, line 4044
Traceback (most recent call last):
File "play.py", line 169, in
AI.run()
File "play.py", line 155, in run
self.play()
File "play.py", line 144, in play
self.target_pos = self.get_target_position(self.state, self.player_pos)
File "play.py", line 95, in get_target_position
pos = multi_scale_search(target, state_cut, 0.4, 15)
File "play.py", line 17, in multi_scale_search
resized = cv2.resize(screen, (int(W * scale), int(H * scale)))
cv2.error: C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\img
proc\src\resize.cpp:4044: error: (-215) ssize.width > 0 && ssize.height > 0 in f
unction cv::resize
python E:\download\Wechat_AutoJump-master\play.py --phone Android --sensitivity 2.045
报错信息
/sdcard/1.png: 1 file pulled. 1.4 MB/s (59991 bytes in 0.041s)
Traceback (most recent call last):
File "E:\download\Wechat_AutoJump-master\play.py", line 172, in
AI.run()
File "E:\download\Wechat_AutoJump-master\play.py", line 157, in run
self.play()
File "E:\download\Wechat_AutoJump-master\play.py", line 137, in play
self.player_pos = self.get_player_position(self.state)
File "E:\download\Wechat_AutoJump-master\play.py", line 84, in get_player_position
pos = multi_scale_search(self.player, state, 0.3, 10)
File "E:\download\Wechat_AutoJump-master\play.py", line 14, in multi_scale_search
h, w = pivot.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
能运行,但一直不跳,操控不了。
下面的data 与log是不是要添加到前面的文件夹当中,我感觉我理解不是很清楚。
IOS+MAC版本 opencv 3.4.0 安装了,运行nnplay 可还是提示这个 import cv2
ImportError: No module named cv2
我已经下载了训练文件并解压放于 resources 目录,安装了 openCV2和 openCV3,运行报如下错,第一句是 python 版本不匹配,那后面的呢:
/Users/CoderJay/tensorflow/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
2018-01-08 14:13:31.602251: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
WARNING:tensorflow:From nn_play.py:72: all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Please use tf.global_variables instead.
2018-01-08 14:13:32.962729: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962751: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962793: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962840: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962842: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962853: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962886: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962922: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.962960: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963019: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963040: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963075: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963116: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963144: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963174: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963195: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963245: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963246: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963343: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963366: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963402: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963418: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963533: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963569: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963595: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963625: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963636: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963669: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963685: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
2018-01-08 14:13:32.963720: W tensorflow/core/framework/op_kernel.cc:1192] Invalid argument: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
Traceback (most recent call last):
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1323, in _do_call
return fn(*args)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1302, in _run_fn
status, run_metadata)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in exit
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "nn_play.py", line 206, in
AI = WechatAutoJump(args.phone, args.sensitivity, args.serverURL, args.debug, args.resource)
File "nn_play.py", line 48, in init
self.load_resource()
File "nn_play.py", line 77, in load_resource
self.saver_coarse.restore(self.sess, self.ckpt)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1666, in restore
{self.saver_def.filename_tensor_name: save_path})
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 889, in run
run_metadata_ptr)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1120, in _run
feed_dict_tensor, options, run_metadata)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1317, in _do_run
options, run_metadata)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1336, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
Caused by op 'save/RestoreV2', defined at:
File "nn_play.py", line 206, in
AI = WechatAutoJump(args.phone, args.sensitivity, args.serverURL, args.debug, args.resource)
File "nn_play.py", line 48, in init
self.load_resource()
File "nn_play.py", line 75, in load_resource
self.saver_coarse = tf.train.Saver(var_coarse)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1218, in init
self.build()
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1227, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1263, in _build
build_save=build_save, build_restore=build_restore)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 751, in _build_internal
restore_sequentially, reshape)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 427, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 267, in restore_op
[spec.tensor.dtype])[0])
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/ops/gen_io_ops.py", line 1021, in restore_v2
shape_and_slices=shape_and_slices, dtypes=dtypes, name=name)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 2956, in create_op
op_def=op_def)
File "/Users/CoderJay/tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1470, in init
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
InvalidArgumentError (see above for traceback): Unsuccessful TensorSliceReader constructor: Failed to get matching files on resource/train_logs_coarse/best_model.ckpt-13999: Not found: resource/train_logs_coarse; No such file or directory
[[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]
MIX2的分辨率是2160X1080,我得怎么改参数才能跳的准呢。
android 小米5S PLUS 分辨率1920*1080跳的不准很少落地中心点,跳到50多久gameover了
OpenCV Error: Assertion failed (ssize.area() > 0) in cv::resize, file ........\opencv\modules\imgproc\src\imgwarp.cpp, line 1968
Traceback (most recent call last):
File "play.py", line 170, in
AI.run()
File "play.py", line 156, in run
self.play()
File "play.py", line 145, in play
self.target_pos = self.get_target_position(self.state, self.player_pos)
File "play.py", line 96, in get_target_position
pos = multi_scale_search(target, state_cut, 0.4, 15)
File "play.py", line 18, in multi_scale_search
resized = cv2.resize(screen, (int(W * scale), int(H * scale)))
cv2.error: ........\opencv\modules\imgproc\src\imgwarp.cpp:1968: error: (-215) ssize.area() > 0 in function cv::resize
这啥情况?
当我运行时出现以下错误提示:
Traceback (most recent call last):
File "/Users/carol/Downloads/Wechat_AutoJump-master/play.py", line 8, in
import cv2
ImportError: No module named cv2
谢谢!
机型:华为荣耀9
系统:安卓
当目标物体颜色和背景色接近时容易跳不准
OpenCV Error: Assertion failed (ssize.width > 0 && ssize.height > 0) in resize, file /Users/travis/build/skvark/opencv-python/opencv/modules/imgproc/src/resize.cpp, line 4044
偶尔连续跳中中心点,有时会跳得前一点,有时会后一点
安装了那些环境,进行运行就能成功了 吗,怎么用adb和手机配置好呀,微信是只用开着就行了吗
前辈,我想在跑训练数据的时候看下opencv的分析过程,如何实现呢。打扰您了。
如果你想从头自己训练: 下载好数据到任意目录下,然后修改cnn_coarse_to_fine/data_provider目录下所有文件的self.data_dir路径。
1这句话读不懂是吧解压后的自己训练的文件改名为self.data_dir吗?
2并放在cnn_coarse_to_fine/data_provider目录下?
3如果模型文件放到相应文件夹下和训练文件放到也放到说明的目录下会冲突吗?
系统是训练还是按照模型文件来执行?还是只能放模型和训练的一种来跑?
我感觉跳的太准会被企鹅发现→_→
我不会Python所以我自己试试
你好,对于训练模型我是新手,但是根据文档提示,做出以下操作:
data
文件解压到本项目中Wechat_AutoJump/data_provider
文件夹下
jump_data_fine.py
文件的 第7行 self.data_dir = '/home/anjie/projects/we_jump/data'
为 self.data_dir = '/Users/ruicky/Documents/github/Wechat_AutoJump/data'
(**注:**后面的路径改为自己的绝对路径)jump_data.py
文件的 第7行 self.data_dir = '/home/anjie/projects/we_jump/data'
为 self.data_dir = '/Users/ruicky/Documents/github/Wechat_AutoJump/data'
(**注:**后面的路径改为自己的绝对路径)fine
用的是fine模型,故:
Wechat_AutoJump/cnn_coarse_to_fine/config/base.fine/train.py
第2行sys.path.append('/home/anjie/projects/we_jump/')
为 sys.path.append('/Users/ruicky/Documents/github/Wechat_AutoJump/')
cd cnn_coarse_to_fine/config/base.fine
python3 train.py -g 0
但是运行以后报错如下:
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
Traceback (most recent call last):
File "train.py", line 7, in <module>
from data_provider.jump_data_fine import JumpData
ModuleNotFoundError: No module named 'data_provider'
希望能帮忙解答以下。
请问cnn_coarse_to_fine/config里面的几个网络,large,larger 和small是指什么(网络大小还是图片),要全部训练还是训练其中一个就好了?
我运行nn.play.py后报错,请问该如何处理。(PS:我直接在终端输入命令回复找不到文件nn.play.py)
ValueError: Variable coarse/conv1/conv1-w already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:
File "/Users/yyzhang/Desktop/Wechat_AutoJump-master/model.py", line 16, in conv2d
w = tf.get_variable('%s-w' % name, shape=ks, initializer=tf.truncated_normal_initializer())
File "/Users/yyzhang/Desktop/Wechat_AutoJump-master/model.py", line 41, in forward
out = self.conv2d('conv1', img, [3, 3, self.input_channle, 16], 2)
File "/Users/yyzhang/Desktop/Wechat_AutoJump-master/nn_play.py", line 67, in load_resource
self.pred = self.net.forward(self.img, self.is_training, self.keep_prob)
只用了你们训练的数据,没有下载data,我自己在跳的过程中还会还会进行训练吗,我跳的越多是否会增加我提高分数的可能性。
我将你们的模型文件下载解压后放到resource文件夹里。读取模型时发生报错
Traceback (most recent call last):
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1327, in _do_call
return fn(*args)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1306, in _run_fn
status, run_metadata)
File "C:\Users\lenovo\Anaconda3\lib\contextlib.py", line 89, in __exit__
next(self.gen)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
[[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/project/Wechat_AutoJump/nn_play.py", line 204, in <module>
AI = WechatAutoJump(args.phone, args.sensitivity, args.debug, args.resource)
File "D:/project/Wechat_AutoJump/nn_play.py", line 47, in __init__
self.load_resource()
File "D:/project/Wechat_AutoJump/nn_play.py", line 77, in load_resource
self.saver_fine.restore(self.sess, self.ckpt_fine)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1560, in restore
{self.saver_def.filename_tensor_name: save_path})
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 895, in run
run_metadata_ptr)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1124, in _run
feed_dict_tensor, options, run_metadata)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1321, in _do_run
options, run_metadata)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1340, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.DataLossError: not an sstable (bad magic number)
[[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
Caused by op 'save_1/RestoreV2', defined at:
File "D:/project/Wechat_AutoJump/nn_play.py", line 204, in <module>
AI = WechatAutoJump(args.phone, args.sensitivity, args.debug, args.resource)
File "D:/project/Wechat_AutoJump/nn_play.py", line 47, in __init__
self.load_resource()
File "D:/project/Wechat_AutoJump/nn_play.py", line 75, in load_resource
self.saver_fine = tf.train.Saver(var_fine)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1140, in __init__
self.build()
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 1172, in build
filename=self._filename)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 688, in build
restore_sequentially, reshape)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 407, in _AddRestoreOps
tensors = self.restore_op(filename_tensor, saveable, preferred_shard)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\training\saver.py", line 247, in restore_op
[spec.tensor.dtype])[0])
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 663, in restore_v2
dtypes=dtypes, name=name)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 767, in apply_op
op_def=op_def)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2630, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Users\lenovo\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1204, in __init__
self._traceback = self._graph._extract_stack() # pylint: disable=protected-access
DataLossError (see above for traceback): not an sstable (bad magic number)
[[Node: save_1/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/cpu:0"](_arg_save_1/Const_0_0, save_1/RestoreV2/tensor_names, save_1/RestoreV2/shape_and_slices)]]
Process finished with exit code 1
我使用的tf版本是1.3.0,Python3.6,Windows10环境运行。
设备:MAC + iphone6 10.3.1
你好当我运行
python3 nn_play.py --phone IOS --sensitivity 2.045
报错如下:
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
return f(*args, **kwds)
2018-01-08 12:44:41.128269: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA
WARNING:tensorflow:From nn_play.py:72: all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
Instructions for updating:
Please use tf.global_variables instead.
==== successfully restored ====
Traceback (most recent call last):
File "nn_play.py", line 210, in <module>
AI.run()
File "nn_play.py", line 195, in run
self.play()
File "nn_play.py", line 174, in play
self.state = self.get_current_state()
File "nn_play.py", line 86, in get_current_state
self.client.screenshot('state.png')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wda/__init__.py", line 295, in screenshot
value = self.http.get('screenshot').value
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wda/__init__.py", line 101, in fetch
return self._fetch_no_alert(method, url, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wda/__init__.py", line 107, in _fetch_no_alert
return httpdo(target_url, method, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/wda/__init__.py", line 83, in httpdo
raise WDAError(r.status, r.value)
wda.WDAError: WDAError(status=13, value=To screenshot a frame, it must have non-0 area.
(
0 CoreFoundation 0x0000000183d92ff0 <redacted> + 148
1 libobjc.A.dylib 0x00000001827f4538 objc_exception_throw + 56
2 CoreFoundation 0x0000000183d92eac <redacted> + 0
3 Foundation 0x000000018482a710 <redacted> + 112
4 XCTest 0x000000010017406c -[XCUIScreen _screenshotDataForQuality:rect:error:] + 192
5 XCTest 0x0000000100173f38 -[XCUIScreen screenshotDataForQuality:rect:error:] + 108
6 WebDriverAgentLib 0x0000000101d87250 -[XCUIDevice(FBHelpers) fb_screenshotWithError:] + 624
7 WebDriverAgentLib 0x0000000101d68d30 +[FBScreenshotCommands handleGetScreenshot:] + 132
8 WebDriverAgentLib 0x0000000101d75984 -[FBRoute_TargetAction mountRequest:intoResponse:] + 208
9 WebDriverAgentLib 0x0000000101d6d5b0 __37-[FBWebServer registerRouteHandlers:]_block_invoke + 496
10 RoutingHTTPServer 0x0000000101e263cc -[RoutingHTTPServer handleRoute:withRequest:response:] + 144
11 RoutingHTTPServer 0x0000000101e26b80 __72-[RoutingHTTPServer routeMethod:withPath:parameters:request:connection:]_block_invoke + 44
12 libdispatch.dylib 0x0000000182c4a9a0 <redacted> + 16
13 libdispatch.dylib 0x0000000182c5b7a8 <redacted> + 304
14 libdispatch.dylib 0x0000000182c4a9a0 <redacted> + 16
15 libdispatch.dylib 0x0000000182c4f5e8 _dispatch_main_queue_callback_4CF + 996
16 CoreFoundation 0x0000000183d410c0 <redacted> + 12
17 CoreFoundation 0x0000000183d3ecdc <redacted> + 1572
18 CoreFoundation 0x0000000183c6ed94 CFRunLoopRunSpecific + 424
19 Foundation 0x0000000184788d64 <redacted> + 304
20 WebDriverAgentLib 0x0000000101d6c5a4 -[FBWebServer startServing] + 424
21 WebDriverAgentRunner 0x0000000101d5bbe4 -[UITestingUITests testRunner] + 132
22 CoreFoundation 0x0000000183d98e80 <redacted> + 144
23 CoreFoundation 0x0000000183c8e2b4 <redacted> + 292
24 XCTest 0x000000010015e654 __24-[XCTestCase invokeTest]_block_invoke.275 + 48
25 XCTest 0x00000001001ac208 -[XCTMemoryChecker _assertInvalidObjectsDeallocatedAfterScope:] + 56
26 XCTest 0x000000010015e404 __24-[XCTestCase invokeTest]_block_invoke + 680
27 XCTest 0x00000001001a49d8 -[XCUITestContext performInScope:] + 208
28 XCTest 0x000000010015e14c -[XCTestCase invokeTest] + 136
29 XCTest 0x000000010015f224 __26-[XCTestCase performTest:]_block_invoke.382 + 48
30 XCTest 0x00000001001a9a78 +[XCTContext runInContextForTestCase:block:] + 164
31 XCTest 0x000000010015ec20 -[XCTestCase performTest:] + 596
32 XCTest 0x000000010015ae14 __27-[XCTestSuite performTest:]_block_invoke + 288
33 XCTest 0x000000010015a83c -[XCTestSuite _performProtectedSectionForTest:testSection:] + 44
34 XCTest 0x000000010015aa4c -[XCTestSuite performTest:] + 236
35 XCTest 0x000000010015ae14 __27-[XCTestSuite performTest:]_block_invoke + 288
36 XCTest 0x000000010015a83c -[XCTestSuite _performProtectedSectionForTest:testSection:] + 44
37 XCTest 0x000000010015aa4c -[XCTestSuite performTest:] + 236
38 XCTest 0x000000010015ae14 __27-[XCTestSuite performTest:]_block_invoke + 288
39 XCTest 0x000000010015a83c -[XCTestSuite _performProtectedSectionForTest:testSection:] + 44
40 XCTest 0x000000010015aa4c -[XCTestSuite performTest:] + 236
41 XCTest 0x00000001001b3484 __44-[XCTTestRunSession runTestsAndReturnError:]_block_invoke + 44
42 XCTest 0x000000010016d994 -[XCTestObservationCenter _observeTestExecutionForBlock:] + 420
43 XCTest 0x00000001001b3300 -[XCTTestRunSession runTestsAndReturnError:] + 292
44 XCTest 0x000000010014a3d4 -[XCTestDriver runTestsAndReturnError:] + 312
45 XCTest 0x00000001001a8c20 _XCTestMain + 620
46 CoreFoundation 0x0000000183d41304 <redacted> + 20
47 CoreFoundation 0x0000000183d40b20 <redacted> + 288
48 CoreFoundation 0x0000000183d3e990 <redacted> + 728
49 CoreFoundation 0x0000000183c6ed94 CFRunLoopRunSpecific + 424
50 GraphicsServices 0x00000001856d8074 GSEventRunModal + 100
51 UIKit 0x0000000189f27130 UIApplicationMain + 208
52 WebDriverAgentRunner-Runner 0x000000010006c444 WebDriverAgentRunner-Runner + 33860
53 libdyld.dylib 0x0000000182c7d59c <redacted> + 4
))
希望能帮我解决一下问题
press_h, press_w = int(0.82*self.resolution[0]), self.resolution [1]//2
cmd = 'adb shell input swipe {} {} {} {} {}'.format(press_w, pre ss_h, press_w, press_h, press_time)
这段代码是按压点?
在play.py的120行左右
控制台信息
adb: error: failed to get feature set: no devices/emulators found
fast-search, step: 0079
adb shell input swipe 540 1574 540 1574 602
error: no devices/emulators found
error: no devices/emulators found
adb: error: failed to get feature set: no devices/emulators found
fast-search, step: 0080
adb shell input swipe 540 1574 540 1574 602
error: no devices/emulators found
error: no devices/emulators found
adb: error: failed to get feature set: no devices/emulators found
fast-search, step: 0081
adb shell input swipe 540 1574 540 1574 602
error: no devices/emulators found
error: no devices/emulators found
adb: error: failed to get feature set: no devices/emulators found
fast-search, step: 0082
adb shell input swipe 540 1574 540 1574 602
540 1574 540 1574 这个数字是定值啊?
python play.py --phone Android --sensitivity 2.045
error: device not found
error: device not found
Traceback (most recent call last):
File "play.py", line 175, in
AI.run()
File "play.py", line 160, in run
self.play()
File "play.py", line 139, in play
self.state = self.get_current_state()
File "play.py", line 71, in get_current_state
self.resolution = state.shape[:2]
AttributeError: 'NoneType' object has no attribute 'shape'
好像每次跳的太准了,都在旗子中间,现在分数只在自己的排行榜中出现,不显示在好友排行榜里……
分也不多,才一千多,排行榜里都6666了
刚刚跑了一下楼主的代码,可以正常运行,好像都跳的不准,不知道是楼主修改代码了还是我手机的问题?
不用GPU加速的话大概多长时间,手机是2960x1440的屏,倒是可以降至1480x720.
能讲一下步骤嘛,或者给几个入门学习的链接。
作为搞驱动的码农,对机器学习有兴趣但是似乎没人交流真玩不转。
控制台运行程序后出现报错:
YydeMacBook-Pro:~ yyzhang$ python /Users/yyzhang/Desktop/Wechat_AutoJump-master/model.py --phone IOS --sensitivity 2.045
Traceback (most recent call last):
File "/Users/yyzhang/Desktop/Wechat_AutoJump-master/model.py", line 65, in
out = model.forward(tf.zeros((1, 640, 720, 3)))
TypeError: forward() missing 2 required positional arguments: 'is_training' and 'keep_prob'
请问该如何处理?
如果你想从头自己训练: 下载好数据到任意目录下,然后修改cnn_coarse_to_fine/data_provider目录下所有文件的self.data_dir路径。
如果你只想跑一下我们的模型: 下载好train log文件(包括train_logs_coarse and train_log_fine)并解压到resource目录。
然后我看了一下train log
竟然有1.22G, 而训练数据data.tar
是239M. 虽然我对机器学习还没入门, 但按目前所了解的, 模型比训练数据大那么多总是不正常的. 模型其实就是几个权重矩阵, 再大应该也大不到这种程度. 真大到这种程度, 就那点训练数据也拟合不了吧
昨天跳了408分(同事也有跳900分)都被记录在排行榜了,但今天跳,高分会在刚跳完体现在排行榜,退出重进就又没有了(别人手机上看一直都是昨天的分数),是不是微信有什么策略来检测这种行为了?
paly.py文件中没有用到TesorFlow,是否说明nn_play.py的效果更好
请问可以在linux下运行吗
$ python play.py --Android --sensitivity 2.045
usage: play.py [-h] [--phone {Android,IOS}] [--sensitivity SENSITIVITY]
[--resource RESOURCE] [--debug DEBUG]
play.py: error: unrecognized arguments: --Android
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.