首页 Paddle框架 帖子详情
No module named 'paddle.fluid.incubate.fleet'怎么解决?
收藏
快速回复
Paddle框架 问答学习资料 716 2
No module named 'paddle.fluid.incubate.fleet'怎么解决?
收藏
快速回复
Paddle框架 问答学习资料 716 2

刚入门,根据官方链接用conda下载好paddlepaddle,想使用时发现一运行就报错,有没有大佬知道什么原因?

运行的是这段代码:(其他代码也试过,同样结果)

# 查看RocketQA提供的预置模型
import paddle.fluid as fluid
import rocketqa
rocketqa_models = rocketqa.available_models()
for m_name in rocketqa_models:
    print (m_name)

报错显示为:

ModuleNotFoundError Traceback (most recent call last)
Cell In[13], line 3
1 # 查看RocketQA提供的预置模型
2 import paddle.fluid as fluid
----> 3 import rocketqa
4 rocketqa_models = rocketqa.available_models()
5 for m_name in rocketqa_models:

File D:\anaconda\lib\site-packages\rocketqa\__init__.py:17
1 # Copyright (c) 2021 RocketQA Authors. All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
(...)
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 __version__ = '1.1.0'
---> 17 from .rocketqa import load_model
18 from .rocketqa import available_models

File D:\anaconda\lib\site-packages\rocketqa\rocketqa.py:11
9 import hashlib
10 from tqdm import tqdm
---> 11 from rocketqa.encoder.dual_encoder import DualEncoder
12 from rocketqa.encoder.cross_encoder import CrossEncoder
14 paddle.enable_static()

File D:\anaconda\lib\site-packages\rocketqa\encoder\dual_encoder.py:43
41 from rocketqa.utils.init import init_pretraining_params, init_checkpoint
42 from rocketqa.utils.finetune_args import parser
---> 43 from rocketqa.utils.optimization import optimization
46 class DualEncoder(object):
48 def __init__(self, conf_path, use_cuda=False, device_id=0, batch_size=1, **kwargs):

File D:\anaconda\lib\site-packages\rocketqa\utils\optimization.py:25
23 import numpy as np
24 import paddle.fluid as fluid
---> 25 from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy
27 def linear_warmup_decay(learning_rate, warmup_steps, num_train_steps):
28 """ Applies linear warmup of learning rate from 0 and decay to 0."""

ModuleNotFoundError: No module named 'paddle.fluid.incubate.fleet'

0
收藏
回复
全部评论(2)
时间顺序
道至夜行
#3 回复于2023-09

之前以为是paddle安装问题,试过删了重下,还是这问题

1
回复
宇宙物语
#4 回复于2023-09

安装旧版本试试

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