X-PLUG / MobileAgent

Mobile-Agent: The Powerful Mobile Device Operation Assistant Family
https://arxiv.org/abs/2406.01014
MIT License
2.67k stars 243 forks source link

TypeError: annotate() got an unexpected keyword argument 'labels' #34

Open hulk-zhk opened 1 month ago

hulk-zhk commented 1 month ago

辛苦看看下面这个报错原因是什么呢?Python版本 3.9.13, 系统版本:windows 10 Traceback (most recent call last): File "D:\Project\script\MobileAgent-main\Mobile-Agent-v2\run.py", line 286, in perception_infos, width, height = get_perception_infos(adb_path, screenshot_file) File "D:\Project\script\MobileAgent-main\Mobile-Agent-v2\run.py", line 190, in get_perception_infos coordinates = det(screenshot_file, "icon", groundingdino_model) File "D:\Project\script\MobileAgent-main\Mobile-Agent-v2\MobileAgent\icon_localization.py", line 45, in det result = groundingdino_model(inputs) File "D:\Env\Python\lib\site-packages\modelscope\pipelines\base.py", line 220, in call output = self._process_single(input, *args, kwargs) File "D:\Env\Python\lib\site-packages\modelscope\pipelines\base.py", line 255, in _process_single out = self.forward(out, forward_params) File "C:\Users\xiaomi.cache\modelscope\modelscope_modules\GroundingDINO\ms_wrapper.py", line 35, in forward return self.model(inputs,forward_params) File "D:\Env\Python\lib\site-packages\modelscope\models\base\base_torch_model.py", line 36, in call return self.postprocess(self.forward(*args, *kwargs)) File "C:\Users\xiaomi.cache\modelscope\modelscope_modules\GroundingDINO\ms_wrapper.py", line 66, in forward annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) File "C:\Users\xiaomi.cache\modelscope\modelscope_modules\GroundingDINO\groundingdino\util\inference.py", line 97, in annotate annotated_frame = box_annotator.annotate( File "D:\Env\Python\lib\site-packages\supervision\utils\conversion.py", line 23, in wrapper return annotate_func(self, scene, args, kwargs) TypeError: annotate() got an unexpected keyword argument 'labels'

junyangwang0410 commented 1 month ago

辛苦看看下面这个报错原因是什么呢?Python版本 3.9.13, 系统版本:windows 10 Traceback (most recent call last): File "D:\Project\script\MobileAgent-main\Mobile-Agent-v2\run.py", line 286, in perception_infos, width, height = get_perception_infos(adb_path, screenshot_file) File "D:\Project\script\MobileAgent-main\Mobile-Agent-v2\run.py", line 190, in get_perception_infos coordinates = det(screenshot_file, "icon", groundingdino_model) File "D:\Project\script\MobileAgent-main\Mobile-Agent-v2\MobileAgent\icon_localization.py", line 45, in det result = groundingdino_model(inputs) File "D:\Env\Python\lib\site-packages\modelscope\pipelines\base.py", line 220, in call output = self._process_single(input, *args, kwargs) File "D:\Env\Python\lib\site-packages\modelscope\pipelines\base.py", line 255, in _process_single out = self.forward(out, forward_params) File "C:\Users\xiaomi.cache\modelscope\modelscope_modules\GroundingDINO\ms_wrapper.py", line 35, in forward return self.model(inputs,forward_params) File "D:\Env\Python\lib\site-packages\modelscope\models\base\base_torch_model.py", line 36, in call return self.postprocess(self.forward(*args, *kwargs)) File "C:\Users\xiaomi.cache\modelscope\modelscope_modules\GroundingDINO\ms_wrapper.py", line 66, in forward annotated_frame = annotate(image_source=image_source, boxes=boxes, logits=logits, phrases=phrases) File "C:\Users\xiaomi.cache\modelscope\modelscope_modules\GroundingDINO\groundingdino\util\inference.py", line 97, in annotate annotated_frame = box_annotator.annotate( File "D:\Env\Python\lib\site-packages\supervision\utils\conversion.py", line 23, in wrapper return annotate_func(self, scene, args, kwargs) TypeError: annotate() got an unexpected keyword argument 'labels'

这个错误是因为supervision更新了,有一些东西被修改了,可以尝试回退supervision的版本: pip install supervision==0.21.0