首页 PaddleHub 帖子详情
module 'paddle' has no attribute 'tensor'
收藏
快速回复
PaddleHub 其他离线运行 7184 6
module 'paddle' has no attribute 'tensor'
收藏
快速回复
PaddleHub 其他离线运行 7184 6
 
我使用import hub 报错:环境:win7 anaconda python3.8 paddlepaddle=2.2.1 paddlehub=2.2.0

AttributeError Traceback (most recent call last)
in
----> 1 import paddlehub as hub

~\anaconda3\lib\site-packages\paddlehub\__init__.py in
16 __version__ = '2.2.0'
17
---> 18 import paddle
19 from packaging.version import Version
20 _paddle_version = Version(paddle.__version__)

~\anaconda3\lib\site-packages\paddle\__init__.py in
25 from .fluid import monkey_patch_variable
26 from .fluid.dygraph import monkey_patch_math_varbase
---> 27 monkey_patch_variable()
28 monkey_patch_math_varbase()
29 from .framework.dtype import dtype as dtype # noqa: F401

~\anaconda3\lib\site-packages\paddle\fluid\layers\math_op_patch.py in monkey_patch_variable()
371 ('ndim', _ndim_),
372 ('__add__', _binary_creator_('__add__', 'elementwise_add', False,
--> 373 _scalar_add_)),
374 # a+b == b+a. Do not need to reverse explicitly
375 ('__radd__',

AttributeError: partially initialized module 'paddle' has no attribute 'tensor' (most likely due to a circular import)

1
收藏
回复
全部评论(6)
时间顺序
DeepGeGe
#2 回复于2022-01

我看到了GitHub上有个人报了类似的错误:AttributeError: partially initialized module 'paddlehub' has no attribute 'Module' (most likely due to a circular import)

他是把一个.py文件名取成了paddlehub,你是不是把一个.py文件的文件名取成了paddle?

1
回复
c
cheeryoung79
#3 回复于2022-01
我看到了GitHub上有个人报了类似的错误:AttributeError: partially initialized module 'paddlehub' has no attribute 'Module' (most likely due to a circular import) 他是把一个.py文件名取成了paddlehub,你是不是把一个.py文件的文件名取成了paddle?
展开

没有。我就是安了一下paddlepaddle,再安paddlehub,再import就报错。没有其他的py文件。

0
回复
c
cheeryoung79
#4 回复于2022-01

问题找到了,安装完paddlepaddle=2.2.1 paddlehub=2.2.0后重启一下系统就好了!

3
回复
A
AIStudio755658
#6 回复于2023-03

跟你一样,但是不行

 

0
回复
豆白
#7 回复于2023-03
跟你一样,但是不行  

请问这个attributeerror解决了吗?同遇到这个问题,在想是不是因为没下载tensorrt

0
回复
逗止
#8 回复于2024-03

重启系统就好了

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户