X-PLUG / MobileAgent

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

运行Mobile-Agent-v2报错 #63

Closed zedisdog closed 2 months ago

zedisdog commented 2 months ago

按照文档上面的步骤操作,最后 python run.py 时报下面的错误.

python version: 3.10.11

下面是错误信息:

(.venv) PS E:\projects\MobileAgent\Mobile-Agent-v2> python run.py
2024-09-22 17:01:15,978 - modelscope - INFO - PyTorch version 2.4.1 Found.
2024-09-22 17:01:15,981 - modelscope - INFO - TensorFlow version 2.9.1 Found.
2024-09-22 17:01:15,981 - modelscope - INFO - Loading ast index from C:\Users\zedsm\.cache\modelscope\ast_indexer
2024-09-22 17:01:16,128 - modelscope - INFO - Loading done! Current index file version is 1.15.0, with md5 61f82e0a104e9ff238d74aac8281df10 and a total number of 980 components indexed
2024-09-22 17:01:17.046201: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2024-09-22 17:01:17.046294: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "E:\projects\MobileAgent\Mobile-Agent-v2\run.py", line 17, in <module>
    from modelscope import snapshot_download, AutoModelForCausalLM, AutoTokenizer, GenerationConfig
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\import_utils.py", line 434, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\import_utils.py", line 451, in _get_module
    return importlib.import_module('.' + module_name, self.__name__)
  File "E:\pyenv-win\pyenv-win\versions\3.10.11\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\hf_util.py", line 5, in <module>
    from transformers import AutoImageProcessor as AutoImageProcessorHF
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1594, in __getattr__
    value = getattr(module, name)
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1593, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1603, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "E:\pyenv-win\pyenv-win\versions\3.10.11\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\models\auto\image_processing_auto.py", line 27, in <module>
    from ...image_processing_utils import BaseImageProcessor, ImageProcessingMixin
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\image_processing_utils.py", line 21, in <module>
    from .image_transforms import center_crop, normalize, rescale
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\image_transforms.py", line 49, in <module>
    import tensorflow as tf
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\__init__.py", line 37, in <module>
    from tensorflow.python.eager import context
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
    from tensorflow.python.client import pywrap_tf_session
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\client\pywrap_tf_session.py", line 19, in <module>
    from tensorflow.python.client._pywrap_tf_session import *
AttributeError: _ARRAY_API not found

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.1 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "E:\projects\MobileAgent\Mobile-Agent-v2\run.py", line 17, in <module>
    from modelscope import snapshot_download, AutoModelForCausalLM, AutoTokenizer, GenerationConfig
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\import_utils.py", line 434, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\import_utils.py", line 451, in _get_module
    return importlib.import_module('.' + module_name, self.__name__)
  File "E:\pyenv-win\pyenv-win\versions\3.10.11\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\hf_util.py", line 5, in <module>
    from transformers import AutoImageProcessor as AutoImageProcessorHF
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1594, in __getattr__
    value = getattr(module, name)
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1593, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1603, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "E:\pyenv-win\pyenv-win\versions\3.10.11\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\models\auto\image_processing_auto.py", line 27, in <module>
    from ...image_processing_utils import BaseImageProcessor, ImageProcessingMixin
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\image_processing_utils.py", line 21, in <module>
    from .image_transforms import center_crop, normalize, rescale
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\image_transforms.py", line 49, in <module>
    import tensorflow as tf
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\__init__.py", line 42, in <module>
    from tensorflow.python import data
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\__init__.py", line 21, in <module>
    from tensorflow.python.data import experimental
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\__init__.py", line 95, in <module>
    from tensorflow.python.data.experimental import service
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\service\__init__.py", line 387, in <module>
    from tensorflow.python.data.experimental.ops.data_service_ops import distribute
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\ops\data_service_ops.py", line 22, in <module>
    from tensorflow.python.data.experimental.ops import compression_ops
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\ops\compression_ops.py", line 16, in <module>
    from tensorflow.python.data.util import structure
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\util\structure.py", line 22, in <module>
    from tensorflow.python.data.util import nest
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\util\nest.py", line 36, in <module>
    from tensorflow.python.framework import sparse_tensor as _sparse_tensor
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\framework\sparse_tensor.py", line 24, in <module>
    from tensorflow.python.framework import constant_op
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\framework\constant_op.py", line 25, in <module>
    from tensorflow.python.eager import execute
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\eager\execute.py", line 23, in <module>
    from tensorflow.python.framework import dtypes
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\framework\dtypes.py", line 26, in <module>
    from tensorflow.python.lib.core import _pywrap_bfloat16
AttributeError: _ARRAY_API not found
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
Traceback (most recent call last):
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1603, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "E:\pyenv-win\pyenv-win\versions\3.10.11\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\models\auto\image_processing_auto.py", line 27, in <module>
    from ...image_processing_utils import BaseImageProcessor, ImageProcessingMixin
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\image_processing_utils.py", line 21, in <module>
    from .image_transforms import center_crop, normalize, rescale
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\image_transforms.py", line 49, in <module>
    import tensorflow as tf
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\__init__.py", line 37, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\__init__.py", line 42, in <module>
    from tensorflow.python import data
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\__init__.py", line 21, in <module>
    from tensorflow.python.data import experimental
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\__init__.py", line 95, in <module>
    from tensorflow.python.data.experimental import service
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\service\__init__.py", line 387, in <module>
    from tensorflow.python.data.experimental.ops.data_service_ops import distribute
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\ops\data_service_ops.py", line 22, in <module>
    from tensorflow.python.data.experimental.ops import compression_ops
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\experimental\ops\compression_ops.py", line 16, in <module>
    from tensorflow.python.data.util import structure
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\util\structure.py", line 22, in <module>
    from tensorflow.python.data.util import nest
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\data\util\nest.py", line 36, in <module>
    from tensorflow.python.framework import sparse_tensor as _sparse_tensor
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\framework\sparse_tensor.py", line 24, in <module>
    from tensorflow.python.framework import constant_op
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\framework\constant_op.py", line 25, in <module>
    from tensorflow.python.eager import execute
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\eager\execute.py", line 23, in <module>
    from tensorflow.python.framework import dtypes
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\tensorflow\python\framework\dtypes.py", line 29, in <module>
    _np_bfloat16 = _pywrap_bfloat16.TF_bfloat16_type()
TypeError: Unable to convert function return value to a Python type! The signature was
        () -> handle

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\import_utils.py", line 451, in _get_module
    return importlib.import_module('.' + module_name, self.__name__)
  File "E:\pyenv-win\pyenv-win\versions\3.10.11\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\hf_util.py", line 5, in <module>
    from transformers import AutoImageProcessor as AutoImageProcessorHF
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1594, in __getattr__
    value = getattr(module, name)
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1593, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\transformers\utils\import_utils.py", line 1605, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.models.auto.image_processing_auto because of the following error (look up to see its traceback):
Unable to convert function return value to a Python type! The signature was
        () -> handle

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "E:\projects\MobileAgent\Mobile-Agent-v2\run.py", line 17, in <module>
    from modelscope import snapshot_download, AutoModelForCausalLM, AutoTokenizer, GenerationConfig
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\import_utils.py", line 434, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "E:\projects\MobileAgent\Mobile-Agent-v2\.venv\lib\site-packages\modelscope\utils\import_utils.py", line 453, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import modelscope.utils.hf_util because of the following error (look up to see its traceback):
Failed to import transformers.models.auto.image_processing_auto because of the following error (look up to see its traceback):
Unable to convert function return value to a Python type! The signature was
        () -> handle
junyangwang0410 commented 2 months ago

可能是numpy版本不兼容,可以按照错误信息重新安装低版本的numpy

zedisdog commented 2 months ago

确实是这样的 :smile: