PaddlePaddle / PaddleHub

Awesome pre-trained models toolkit based on PaddlePaddle. (400+ models including Image, Text, Audio, Video and Cross-Modal with Easy Inference & Serving)【安全加固,暂停交互,请耐心等待】
https://www.paddlepaddle.org.cn/hub
Apache License 2.0
12.74k stars 2.07k forks source link

ImportError: cannot import name 'RNNCell' from 'paddle.fluid.layers' (D:\software\lib\site-packages\paddle\fluid\layers\__init__.py) #2283

Closed dididiskq closed 1 year ago

dididiskq commented 1 year ago

How to solve it

TTyb commented 1 year ago

同样的问题

hcx1002 commented 1 year ago

用paddle2.4版本就可以

PhilanthropistBright commented 1 year ago

同样的问题 试了2.4.0 和2.4.2的版本 一样不行

fuzhao123232 commented 1 year ago

卡了一下午,百度在干嘛啊,bug也不修复

qq545622333 commented 1 year ago

我也试了2.4.0,有其他报错 Traceback (most recent call last): File "d:/Work/Paddle/Test1/tesst.py", line 1, in import paddlehub File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlehub__init.py", line 31, in from paddlehub import datasets File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlehub\datasets\init.py", line 16, in from paddlehub.datasets.chnsenticorp import ChnSentiCorp File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlehub\datasets\chnsenticorp.py", line 19, in from paddlehub.datasets.base_nlp_dataset import TextClassificationDataset File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlehub\datasets\base_nlp_dataset.py", line 21, in import paddlenlp File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlenlp\init.py", line 35, in from . import ( File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlenlp\data\init.py", line 16, in from .data_collator import * File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlenlp\data\data_collator.py", line 26, in from ..transformers import BertTokenizer File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlenlp\transformers\init__.py", line 17, in from .model_utils import PretrainedModel, register_base_model File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlenlp\transformers\model_utils.py", line 63, in from .generation_utils import GenerationMixin File "D:\ProgramData\anaconda3\envs\PaddleTest\lib\site-packages\paddlenlp\transformers\generation_utils.py", line 29, in from paddle.nn.layer.layers import in_declarative_mode ModuleNotFoundError: No module named 'paddle.nn.layer.layers'

whisky-12 commented 1 year ago

同样的错误 感觉像python版本的冲突 或者paddle的 好几个环境 有的可以有的不可以

GuanghuiMin commented 1 year ago

同样的问题,希望官方能解决

monkeycc commented 1 year ago

pip install paddlenlp==2.5.2

rainyfly commented 1 year ago

现阶段有效版本可按如下方式安装(以anaconda作为环境管理工具为例):

conda create -n py38 python==3.8 conda activate py38 python -m pip install paddlepaddle-gpu==2.5.1 -i https://pypi.tuna.tsinghua.edu.cn/simple pip install paddlehub==2.4.0