PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.18k stars 5.57k forks source link

安装paddleseg后不能正常使用 #49440

Closed pjyaaa closed 9 months ago

pjyaaa commented 1 year ago

问题描述 Issue Description

在canda下创建虚拟python环境,python3.8,安装飞浆2.4操作系统windows安装方式pip计算平台cpu后,提示安装成功,后用验证方式import paddle,再输入paddle.utils.run_check()后显示paddlepaddle安装成功,具体验证代码见下: (paddleseg) C:\windows\system32>python Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

import paddle paddle.utils.run_check() Running verify PaddlePaddle program ... PaddlePaddle works well on 1 CPU. C:\ProgramData\Anaconda3\envs\paddleseg\lib\site-packages\paddle\fluid\executor.py:1583: UserWarning: Standalone executor is not used for data parallel warnings.warn( W1229 16:36:54.127283 3436 fuse_all_reduce_op_pass.cc:79] Find all_reduce operators: 2. To make the speed faster, some all_reduce ops are fused during training, after fusion, the number of all_reduce ops is 2. PaddlePaddle works well on 2 CPUs. PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now. 后再安装paddleseg提示安装成功后,输入EISeg启动应用,提示找不到paddle,具体步骤见下: (paddleseg) C:\windows\system32>EISeg Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\Scripts\eiseg.exe__main__.py", line 4, in

you may not use this file except in compliance with the License.

File "C:\ProgramData\Anaconda3\lib\site-packages\eiseg\run.py", line 25, in from app import APP_EISeg # 导入带槽的界面 File "C:\ProgramData\Anaconda3\Lib\site-packages\eiseg\app.py", line 32, in import paddle ModuleNotFoundError: No module named 'paddle'

版本&环境信息 Version & Environment Information

paddle version:2.4.1 os:Windows 10 企业版

paddle-bot[bot] commented 1 year ago

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

From00 commented 1 year ago

你好,可能你运行PaddleSeg和安装Paddle的python环境不是同一个。请检查下运行环境中是否已经安装了Paddle。

pjyaaa commented 1 year ago

(base) C:\windows\system32>conda activate paddleseg

(paddleseg) C:\windows\system32>python Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information.

运行paddleseg的环境中有python

From00 commented 1 year ago

这个错误是因为你环境中的Paddle没安装好导致的。由于没有可以实际操作的环境,我们无法直接帮你定位到环境中的具体问题。建议尝试重新搭建环境,然后遵照官网的安装指南重新安装paddle,看是否可以解决问题。 https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/pip/windows-pip.html

pjyaaa commented 1 year ago

第一步,通过conda create -n paddleseg1 python=3.9创建一个python虚拟环境,以下显示创建成功: done #

To activate this environment, use

#

$ conda activate paddleseg1

#

To deactivate an active environment, use

#

$ conda deactivate

第二步通过conda activate paddleseg1,激活并进入paddleseg1虚拟环境,通过python --version查看环境中python版本,见以下: (base) C:\Users\p'j'y>conda activate paddleseg1

(paddleseg1) C:\Users\p'j'y>python --version Python 3.9.15

第三步安装paddlepaddle (paddleseg1) C:\Users\p'j'y>python -m pip install paddlepaddle==2.4.1 -i https://pypi.tuna.tsinghua.edu.cn/simple Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting paddlepaddle==2.4.1 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/60/96/f1406fdd6e63c06dd51f88d8468aa0fc37370ace80ad48727b4c0ae2d9c5/paddlepaddle-2.4.1-cp39-cp39-win_amd64.whl (68.5 MB) Collecting Pillow Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c0/8f/dfa473f3a6241bff91ae8bb905bd0afceb827f37de2917a94b5c4b1112bf/Pillow-9.3.0-cp39-cp39-win_amd64.whl (2.5 MB) ---------------------------------------- 2.5/2.5 MB 3.7 MB/s eta 0:00:00 Collecting protobuf<=3.20.0,>=3.1.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/07/96/a3cae1ce36af23dc0df53ce36ae4cd0be677d243dbd4f98b9b52f4c91a32/protobuf-3.20.0-cp39-cp39-win_amd64.whl (904 kB) ---------------------------------------- 904.1/904.1 kB 4.8 MB/s eta 0:00:00 Collecting numpy>=1.13 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/37/15/5667b269bf2c3473133823733fc0cd8fa44850e4c1d61b45bccc798a3e5a/numpy-1.24.1-cp39-cp39-win_amd64.whl (14.9 MB) ---------------------------------------- 14.9/14.9 MB 9.9 MB/s eta 0:00:00 Collecting six Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting decorator Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6/decorator-5.1.1-py3-none-any.whl (9.1 kB) Collecting requests>=2.20.0 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ca/91/6d9b8ccacd0412c08820f72cebaa4f0c0441b5cda699c90f618b6f8a1b42/requests-2.28.1-py3-none-any.whl (62 kB) Collecting paddle-bfloat==0.1.7 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/49/56/0daf8b1dde01482f74e18ca7ef2a6fb1485b7479e1cee991d0e7d10ba2df/paddle_bfloat-0.1.7-cp39-cp39-win_amd64.whl (39 kB) Collecting opt-einsum==3.3.0 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB) Collecting astor Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl (27 kB) Requirement already satisfied: certifi>=2017.4.17 in c:\users\p'j'y.conda\envs\paddleseg1\lib\site-packages (from requests>=2.20.0->paddlepaddle==2.4.1) (2022.12.7) Collecting urllib3<1.27,>=1.21.1 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/65/0c/cc6644eaa594585e5875f46f3c83ee8762b647b51fc5b0fb253a242df2dc/urllib3-1.26.13-py2.py3-none-any.whl (140 kB) Collecting charset-normalizer<3,>=2 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/db/51/a507c856293ab05cdc1db77ff4bc1268ddd39f29e7dc4919aa497f0adbec/charset_normalizer-2.1.1-py3-none-any.whl (39 kB) Collecting idna<4,>=2.5 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (61 kB) Installing collected packages: paddle-bfloat, urllib3, six, protobuf, Pillow, numpy, idna, decorator, charset-normalizer, astor, requests, opt-einsum, paddlepaddle Successfully installed Pillow-9.3.0 astor-0.8.1 charset-normalizer-2.1.1 decorator-5.1.1 idna-3.4 numpy-1.24.1 opt-einsum-3.3.0 paddle-bfloat-0.1.7 paddlepaddle-2.4.1 protobuf-3.20.0 requests-2.28.1 six-1.16.0 urllib3-1.26.13

第四步验证paddlepaddle是否安装成功,见以下: (paddleseg1) C:\Users\p'j'y>python Python 3.9.15 (main, Nov 24 2022, 14:39:17) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import paddle paddle.utils.run_check() Running verify PaddlePaddle program ... PaddlePaddle works well on 1 CPU. C:\Users\p'j'y.conda\envs\paddleseg1\lib\site-packages\paddle\fluid\executor.py:1583: UserWarning: Standalone executor is not used for data parallel warnings.warn( W1230 10:40:47.479625 11732 fuse_all_reduce_op_pass.cc:79] Find all_reduce operators: 2. To make the speed faster, some all_reduce ops are fused during training, after fusion, the number of all_reduce ops is 2. PaddlePaddle works well on 2 CPUs. PaddlePaddle is installed successfully! Let's start deep learning with PaddlePaddle now.

第五步安装paddleseg之前先检查下环境,见以下: (paddleseg1) C:\Users\p'j'y>python -m pip --version pip 22.3.1 from C:\Users\p'j'y.conda\envs\paddleseg1\lib\site-packages\pip (python 3.9)

(paddleseg1) C:\Users\p'j'y>python -c "import platform;print(platform.architecture()[0]);print(platform.machine())" 64bit AMD64

第六步安装paddleseg,见以下: (paddleseg1) C:\Users\p'j'y>python -m pip install paddleseg Successfully built sklearn future Installing collected packages: wcwidth, pytz, zipp, threadpoolctl, scipy, pyyaml, python-dateutil, pyparsing, pycryptodome, prettytable, packaging, opencv-python, MarkupSafe, kiwisolver, joblib, itsdangerous, future, fonttools, filelock, dill, cycler, contourpy, colorama, Babel, Werkzeug, tqdm, scikit-learn, pandas, multiprocess, matplotlib, Jinja2, importlib-metadata, click, bce-python-sdk, sklearn, flask, Flask-Babel, visualdl, paddleseg Successfully installed Babel-2.11.0 Flask-Babel-2.0.0 Jinja2-3.1.2 MarkupSafe-2.1.1 Werkzeug-2.2.2 bce-python-sdk-0.8.74 click-8.1.3 colorama-0.4.6 contourpy-1.0.6 cycler-0.11.0 dill-0.3.6 filelock-3.9.0 flask-2.2.2 fonttools-4.38.0 future-0.18.2 importlib-metadata-5.2.0 itsdangerous-2.1.2 joblib-1.2.0 kiwisolver-1.4.4 matplotlib-3.6.2 multiprocess-0.70.14 opencv-python-4.6.0.66 packaging-22.0 paddleseg-2.7.0 pandas-1.5.2 prettytable-3.5.0 pycryptodome-3.16.0 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2022.7 pyyaml-6.0 scikit-learn-1.2.0 scipy-1.9.3 sklearn-0.0 threadpoolctl-3.1.0 tqdm-4.64.1 visualdl-2.4.2 wcwidth-0.2.5 zipp-3.11.0

第七步启动eiseg,见以下错误: (paddleseg1) C:\Users\p'j'y>eiseg Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\ProgramData\Anaconda3\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\Scripts\eiseg.exe__main__.py", line 4, in

you may not use this file except in compliance with the License.

File "C:\ProgramData\Anaconda3\lib\site-packages\eiseg\run.py", line 25, in from app import APP_EISeg # 导入带槽的界面 File "C:\ProgramData\Anaconda3\Lib\site-packages\eiseg\app.py", line 32, in import paddle ModuleNotFoundError: No module named 'paddle'

pjyaaa commented 1 year ago

又重新操作了一遍按上述步骤,还是同样的错误。

From00 commented 1 year ago

如果不使用conda也会有一样的错误吗?

pjyaaa commented 1 year ago

这个之前有试过,怀疑电脑上会不会有多个python引起的问题,所以用conda建一个python虚拟环境再试下

From00 commented 1 year ago

那如果不通过eiseg运行,而是通过exe.py来打开EISeg:

cd PaddleSeg\EISeg\eiseg
python exe.py

也会有这个问题吗?

pjyaaa commented 1 year ago

按上述方法运行后,运行到以下步骤就不动了: e[37m--- fused 0 elementwise_mul with gelu activatione[0m e[37m--- fused 0 elementwise_mul with hard_sigmoid activatione[0m e[37m--- fused 0 elementwise_mul with hard_swish activatione[0m e[37m--- fused 0 elementwise_mul with leaky_relu activatione[0m e[37m--- fused 0 elementwise_mul with mish activatione[0m e[37m--- fused 0 elementwise_mul with relu activatione[0m e[37m--- fused 0 elementwise_mul with relu6 activatione[0m e[37m--- fused 0 elementwise_mul with sigmoid activatione[0m e[37m--- fused 0 elementwise_mul with sqrt activatione[0m e[37m--- fused 0 elementwise_mul with swish activatione[0m e[37m--- fused 0 elementwise_mul with tanh activatione[0m e[32m--- Running IR pass [operator_scale_onednn_fuse_pass]e[0m e[32m--- Running IR pass [operator_unsqueeze2_onednn_fuse_pass]e[0m I1230 16:45:26.867242 924 fuse_pass_base.cc:59] --- detected 2 subgraphs e[37m--- fused 2 transpose2 with unsqueeze2e[0m e[32m--- Running IR pass [operator_reshape2_onednn_fuse_pass]e[0m e[1me[35m--- Running analysis [ir_params_sync_among_devices_pass]e[0m e[1me[35m--- Running analysis [adjust_cudnn_workspace_size_pass]e[0m e[1me[35m--- Running analysis [inference_op_replace_pass]e[0m e[1me[35m--- Running analysis [ir_graph_to_program_pass]e[0m I1230 16:45:27.257805 924 analysis_predictor.cc:1314] ======= optimize end ======= I1230 16:45:27.257805 924 naive_executor.cc:110] --- skip [feed], feed -> coord_features_org I1230 16:45:27.257805 924 naive_executor.cc:110] --- skip [feed], feed -> image I1230 16:45:27.273427 924 naive_executor.cc:110] --- skip [save_infer_model/scale_0.tmp_1], fetch -> fetch I1230 16:45:27.273427 924 naive_executor.cc:110] --- skip [save_infer_model/scale_1.tmp_1], fetch -> fetch I1230 16:45:27.273427 924 naive_executor.cc:110] --- skip [save_infer_model/scale_2.tmp_1], fetch -> fetch

haoyuying commented 1 year ago
image

在paddleseg1这个环境下安装eiseg, pip install eiseg, 然后随便找一个目录下没有eiseg文件夹的位置输入eiseg进行启动,看这个报错位置,eiseg和paddle没有装在同一个环境下,不然C:\ProgramData\Anaconda3\lib\site-packages\eiseg\run.py这个文件应该是在conda下的一个虚拟环境的文件夹下,但现在这个位置显然不是。

paddle-bot[bot] commented 9 months ago

Since you haven\'t replied for more than a year, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. 由于您超过一年未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。