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

运行PaddleRS项目,报错 #178

Closed
jiangming7301 opened this issue Nov 23, 2023 · 8 comments
Closed

运行PaddleRS项目,报错 #178

jiangming7301 opened this issue Nov 23, 2023 · 8 comments
Assignees
Labels
question Further information is requested stale old issue/PR without interaction for a long time

Comments

@jiangming7301
Copy link

项目链接:https://aistudio.baidu.com/projectdetail/4967734?channelType=0&channel=0
fork项目后,运行到构建模型,报以下错误:
Can not use conditional_random_field. Please install pydensecrf first.
Can not import map_display. This is probably because GDAL is not properly installed.
Warning: import ppdet from source directory without installing, run 'python setup.py install' to install ppdet firstly

ImportError Traceback (most recent call last)
Cell In[7], line 2
1 # 导入PaddleRS库
----> 2 import paddlers as pdrs
4 # 调用PaddleRS API一键构建模型
5 model = pdrs.tasks.cd.BIT(
6 # 模型输出类别数
7 num_classes=2,
(...)
33 dec_head_dim=8
34 )

File ~/PaddleRS/paddlers/init.py:18
15 import os
17 from paddlers.utils.env import get_environ_info, init_parallel_env
---> 18 from . import tasks, datasets, transforms, utils, tools, models, deploy
20 init_parallel_env()
21 env_info = get_environ_info()

File ~/PaddleRS/paddlers/tasks/init.py:15
1 # Copyright (c) 2022 PaddlePaddle 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 import paddlers.tasks.object_detector as detector
16 import paddlers.tasks.segmenter as segmenter
17 import paddlers.tasks.change_detector as change_detector

File ~/PaddleRS/paddlers/tasks/object_detector.py:35
33 import paddlers.utils.logging as logging
34 from paddlers.utils.checkpoint import det_pretrain_weights_dict
---> 35 from .base import BaseModel
36 from .utils.det_metrics import VOCMetric, COCOMetric, RBoxMetric
38 all = [
39 "YOLOv3",
40 "FasterRCNN",
(...)
46 "PPYOLOE_R",
47 ]

File ~/PaddleRS/paddlers/tasks/base.py:27
25 import paddle
26 from paddle.io import DataLoader, DistributedBatchSampler
---> 27 from paddleslim import QAT
28 from paddleslim.analysis import flops
29 from paddleslim import L1NormFilterPruner, FPGMFilterPruner

File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/init.py:16
1 # Copyright (c) 2019 PaddlePaddle 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 from future import absolute_import
---> 16 from paddleslim import models
17 from paddleslim import prune
18 from paddleslim import nas

File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/init.py:16
1 # Copyright (c) 2020 PaddlePaddle 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 from future import absolute_import
---> 16 from .util import image_classification
17 from .slimfacenet import SlimFaceNet_A_x0_60, SlimFaceNet_B_x0_75, SlimFaceNet_C_x0_75
18 from .slim_mobilenet import SlimMobileNet_v1, SlimMobileNet_v2, SlimMobileNet_v3, SlimMobileNet_v4, SlimMobileNet_v5

File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/util.py:3
1 from future import absolute_import
2 import paddle.fluid as fluid
----> 3 from ..models import classification_models
5 all = ["image_classification"]
7 model_list = classification_models.model_list

File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/classification_models.py:2
1 from future import absolute_import
----> 2 from .mobilenet import MobileNet
3 from .resnet import ResNet34, ResNet50
4 from .mobilenet_v2 import MobileNetV2

File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/mobilenet.py:5
3 from future import print_function
4 import paddle.fluid as fluid
----> 5 from paddle.fluid.initializer import MSRA
6 from paddle.fluid.param_attr import ParamAttr
8 all = ['MobileNet']

ImportError: cannot import name 'MSRA' from 'paddle.fluid.initializer' (/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/fluid/initializer.py)

@jiangming7301 jiangming7301 added the question Further information is requested label Nov 23, 2023
@github-actions github-actions bot added the triage new issue/PR waiting to be dealed label Nov 23, 2023
@Bobholamovic
Copy link
Member

PaddleRS 1.0不兼容Paddle 2.5,需要安装PaddleRS develop版本以及PaddleSlim develop版本~

@jiangming7301
Copy link
Author

模型训练完,导出模型报错:信息如下:

Can not use conditional_random_field. Please install pydensecrf first.
Can not import map_display. This is probably because GDAL is not properly installed.
Warning: import ppdet from source directory without installing, run 'python setup.py install' to install ppdet firstly
Traceback (most recent call last):
File "/home/aistudio/PaddleRS/deploy/export/export_model.py", line 19, in
from paddlers.tasks import load_model
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlers/init.py", line 18, in
from . import tasks, datasets, transforms, utils, tools, models, deploy
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlers/tasks/init.py", line 15, in
import paddlers.tasks.object_detector as detector
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlers/tasks/object_detector.py", line 35, in
from .base import BaseModel
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddlers/tasks/base.py", line 27, in
from paddleslim import QAT
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/init.py", line 16, in
from paddleslim import models
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/init.py", line 16, in
from .util import image_classification
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/util.py", line 3, in
from ..models import classification_models
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/classification_models.py", line 2, in
from .mobilenet import MobileNet
File "/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddleslim/models/mobilenet.py", line 5, in
from paddle.fluid.initializer import MSRA
ImportError: cannot import name 'MSRA' from 'paddle.fluid.initializer' (/opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/fluid/initializer.py)

@jiangming7301
Copy link
Author

jiangming7301 commented Nov 24, 2023

!python PaddleRS/deploy/export/export_model.py --model_dir=exp/best_model --save_dir=exp/best_model/static --fixed_input_shape [-1,3,256,256]模型导出命令

@jiangming7301
Copy link
Author

有没有解决方法

@jiangming7301
Copy link
Author

有没有人帮处理啊?

1 similar comment
@jiangming7301
Copy link
Author

有没有人帮处理啊?

@Bobholamovic
Copy link
Member

PaddleRS 1.0不兼容Paddle 2.5,需要安装PaddleRS develop版本以及PaddleSlim develop版本~

你好,是版本问题哈,参考我的这个回答

@github-actions github-actions bot removed the triage new issue/PR waiting to be dealed label Feb 26, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale old issue/PR without interaction for a long time label Apr 26, 2024
@github-actions github-actions bot closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale old issue/PR without interaction for a long time
Projects
None yet
Development

No branches or pull requests

2 participants