Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

paddle.utils.run_check() TypeError: __array__(): incompatible function arguments. Invoked with: <paddle.base.libpaddle.Tensor object at 0x0000014E881321B0>; kwargs: copy=True #67599

Open
chenmohan123 opened this issue Aug 21, 2024 · 3 comments
Assignees

Comments

@chenmohan123
Copy link

bug描述 Describe the Bug

conda create --name PaddleDetection_env
conda activate PaddleDetection_env

conda install python

通过 pip install paddlepaddle==2.6.1 安装后,运行 paddle.utils.run_check() 则出现下面的错误:

Running verify PaddlePaddle program ...
I0821 13:44:39.746835  7284 program_interpreter.cc:212] New Executor is Running.
I0821 13:44:39.772833  7284 interpreter_util.cc:624] Standalone Executor is Used.
Traceback (most recent call last):
  File "c:\Disk1\git\python_test_project\example_PaddleDetection\test.py", line 3, in <module>
    paddle.utils.run_check()
  File "C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env\Lib\site-packages\paddle\utils\install_check.py", line 273, in run_check
    _run_static_single(use_cuda, use_xpu, use_custom, custom_device_name)
  File "C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env\Lib\site-packages\paddle\utils\install_check.py", line 151, in _run_static_single
    exe.run(
  File "C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env\Lib\site-packages\paddle\base\executor.py", line 1746, in run
    res = self._run_impl(
          ^^^^^^^^^^^^^^^
  File "C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env\Lib\site-packages\paddle\base\executor.py", line 1952, in _run_impl
    ret = new_exe.run(
          ^^^^^^^^^^^^
  File "C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env\Lib\site-packages\paddle\base\executor.py", line 835, in run
    tensors = as_numpy(tensors, copy=True)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env\Lib\site-packages\paddle\base\executor.py", line 156, in as_numpy
    return [as_numpy(t, copy) for t in tensor]
            ^^^^^^^^^^^^^^^^^
  File "C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env\Lib\site-packages\paddle\base\executor.py", line 168, in as_numpy
    return np.array(tensor)
           ^^^^^^^^^^^^^^^^
TypeError: __array__(): incompatible function arguments. The following argument types are supported:
    1. (self: paddle.base.libpaddle.Tensor) -> numpy.ndarray

Invoked with: <paddle.base.libpaddle.Tensor object at 0x0000014E881321B0>; kwargs: copy=True

截图如下:
QQ20240821-135221

系统信息:
Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz 3.20 GHz
Windows 10 专业版 22H2 19045.4780
Intel集成显卡
16G内存

conda list

(PaddleDetection_env) C:\Disk1\git\python_test_project\example_PaddleDetection>conda list
# packages in environment at C:\Users\chenmohan\anaconda3\envs\PaddleDetection_env:
#
# Name                    Version                   Build  Channel
anyio                     4.4.0                    pypi_0    pypi
astor                     0.8.1                    pypi_0    pypi
bzip2                     1.0.8                h2bbff1b_6
ca-certificates           2024.7.2             haa95532_0
certifi                   2024.7.4                 pypi_0    pypi
decorator                 5.1.1                    pypi_0    pypi
expat                     2.6.2                hd77b12b_0
h11                       0.14.0                   pypi_0    pypi
httpcore                  1.0.5                    pypi_0    pypi
httpx                     0.27.0                   pypi_0    pypi
idna                      3.7                      pypi_0    pypi
libffi                    3.4.4                hd77b12b_1
numpy                     2.1.0                    pypi_0    pypi
openssl                   3.0.14               h827c3e9_0
opt-einsum                3.3.0                    pypi_0    pypi
paddlepaddle              2.6.1                    pypi_0    pypi
pillow                    10.4.0                   pypi_0    pypi
pip                       24.2            py312haa95532_0
protobuf                  3.20.2                   pypi_0    pypi
python                    3.12.4               h14ffc60_1
setuptools                72.1.0          py312haa95532_0
sniffio                   1.3.1                    pypi_0    pypi
sqlite                    3.45.3               h2bbff1b_0
tk                        8.6.14               h0416ee5_0
tzdata                    2024a                h04d1e81_0
vc                        14.40                h2eaa2aa_0
vs2015_runtime            14.40.33807          h98bb1dd_0
wheel                     0.43.0          py312haa95532_0
xz                        5.4.6                h8cc25b3_1
zlib                      1.2.13               h8cc25b3_1

其他补充信息 Additional Supplementary Information

No response

@chenmohan123
Copy link
Author

补充一下:3.0.0b1 版本运行正常。

Running verify PaddlePaddle program ... 
I0821 14:04:59.503650  8808 program_interpreter.cc:243] New Executor is Running.
I0821 14:04:59.527164  8808 interpreter_util.cc:648] Standalone Executor is Used.
PaddlePaddle works well on 1 CPU.
PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

@chenmohan123
Copy link
Author

再补充一下:python==3.9.19 + paddlepaddle==2.6.1 也正常。初步判断是 python 3.12 版本导致的。

@JZ-LIANG
Copy link
Contributor

感谢反馈,建议使用先行 python 3.9 运行,我们内部 会记录并反馈修复这样 bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants