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

PGL在aistudio进行import时报错 #566

Open
nongdaxiaofeng opened this issue Jul 7, 2023 · 3 comments
Open

PGL在aistudio进行import时报错 #566

nongdaxiaofeng opened this issue Jul 7, 2023 · 3 comments

Comments

@nongdaxiaofeng
Copy link


ImportError Traceback (most recent call last)
/tmp/ipykernel_227/4261471993.py in
----> 1 import pgl

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pgl/init.py in
25 % paddle.version)
26
---> 27 from pgl import graph
28 from pgl import graph_kernel
29 from pgl import math

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pgl/graph.py in
28
29 import pgl
---> 30 from pgl.utils import op
31 import pgl.graph_kernel as graph_kernel
32 from pgl.message import Message

/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pgl/utils/op.py in
17 """
18 import paddle
---> 19 from paddle import _C_ops, _legacy_C_ops
20 import numpy as np
21 from pgl.utils.helper import check_is_tensor

ImportError: cannot import name '_legacy_C_ops' from 'paddle' (/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/init.py)

@nongdaxiaofeng nongdaxiaofeng changed the title PGL在aistudioimport进行import时报错 Jul 7, 2023
@akari0216
Copy link

去修改aistudio上该项目的paddle环境,即在项目主界面的右边有“删除” “修改” “设置为公开”那里, 点击修改, 把通用框架修改为paddle 2.4.0版本或以上,保存,即可修复该import问题。

原因我猜是paddle新版的api兼容性问题,参考issue:import error

@akari0216
Copy link

经测试,最新版本的pgl运行模型会报bug,参见issueValueError: (InvalidArgument) argument (position 2) must be list of int, but got memmap at pos 0,建议是指定安装版本pip install pgl==2.2.4,paddle版本需2.2.0及以上即可

@sunyrain
Copy link

pip install pgl==2.2.4
Looking in indexes: http://mirrors.aliyun.com/pypi/simple
ERROR: Could not find a version that satisfies the requirement pgl==2.2.4 (from versions: 2.2.3)
ERROR: No matching distribution found for pgl==2.2.4
不知道为什么装不了2.2.4

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