Giter VIP home page Giter VIP logo

Comments (9)

zzjjay avatar zzjjay commented on May 23, 2024

这里的敏感度分析使用的是静态图代码,其中 ‘from ppdet.data.reader import create_reader’ 调用的是 static/ppdet/data/reader.py 中的函数,由于pip安装的是动态图paddledection,所以会找不到该函数。
解决方法:

  • 可以pip uninstall paddledection后重新执行;
  • 或者修改sensitive.py中 create_reader的调用路径;

from paddleslim.

Oliver6565 avatar Oliver6565 commented on May 23, 2024

是从重新安装paddledection版本可以吗 0.5版本?,那对应的paddle是多少版本呢?因为我单独改create_reader,后续很多方法调用路径也有问题。

from paddleslim.

zzjjay avatar zzjjay commented on May 23, 2024

安装0.5版本可以调用create_reader,但对应的paddle版本太低了,可能会有新的问题;
卸载paddledection后,直接执行sensitive.py就行了

from paddleslim.

Oliver6565 avatar Oliver6565 commented on May 23, 2024

paddlepaddle 2.1。paddleslim2.1 加上 PaddleDetedction工具包就可以执行吗? 我会有另外的问题,

aistudio@jupyter-2373595-7476238:/PaddleDetection$ python static/slim/sensitive/sensitive.py -c configs/yolov3/yolov3_mobilenet_v3_270e_voc.yml -p
[02-22 11:04:27 MainThread @logger.py:242] Argv: static/slim/sensitive/sensitive.py -c configs/yolov3/yolov3_mobilenet_v3_270e_voc.yml -p
[02-22 11:04:27 MainThread @utils.py:79] WRN paddlepaddle version: 2.1.2. The dynamic graph version of PARL is under development, not fully tested and supported
Traceback (most recent call last):
File "static/slim/sensitive/sensitive.py", line 36, in
from paddleslim.prune import sensitivity
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/init.py", line 17, in
from paddleslim import prune
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/prune/init.py", line 16, in
from .pruner import *
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/prune/pruner.py", line 20, in
from ..core import VarWrapper, OpWrapper, GraphWrapper
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/core/init.py", line 19, in
from ..core import dygraph
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/core/dygraph.py", line 9, in
from ..common import get_logger
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/common/init.py", line 21, in
from .server import Server
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/common/server.py", line 28, in
from .rl_controller.utils import add_grad, ConnectMessage
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddleslim/common/rl_controller/init.py", line 19, in
import parl
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/parl/init.py", line 47, in
from parl.remote import remote_class, connect
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/parl/remote/init.py", line 19, in
from parl.remote.remote_decorator import *
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/parl/remote/remote_decorator.py", line 19, in
from parl.remote.remote_wrapper import RemoteWrapper
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/parl/remote/remote_wrapper.py", line 21, in
from parl.remote.communication import loads_argument, loads_return,
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/parl/remote/communication.py", line 38, in
context = pyarrow.default_serialization_context()
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/pyarrow/init.py", line 317, in getattr
"module 'pyarrow' has no attribute '{0}'".format(name)
AttributeError: module 'pyarrow' has no attribute 'default_serialization_context'
aistudio@jupyter-2373595-7476238:
/PaddleDetection$

from paddleslim.

Oliver6565 avatar Oliver6565 commented on May 23, 2024

能否有一个版本对应能跑出来的吗?就是目标检测网络明感度分析? 使用paddledetection。

from paddleslim.

Oliver6565 avatar Oliver6565 commented on May 23, 2024

image

在剪枝的时候,我是这样配置的剪枝率。因为查不到其敏感度,我根据ppyolo mbv3 large的剪枝率来配置的。您们有关于这部分的配置吗?

from paddleslim.

zzjjay avatar zzjjay commented on May 23, 2024

这个剪枝率应该设置反了吧,0.75太大了,会导致较大的精度损失,应该是0.25比较合理。

我们没有做过ppyolo mbv3 large的剪枝实验,可以按照示例去尝试运行剪枝敏感度分析~

from paddleslim.

Oliver6565 avatar Oliver6565 commented on May 23, 2024

我就是设置的0.75,只剪枝了6个层,精度最后还行。voc上精度下降2-3%。
敏感度分析就是按照示例分析不出来。。。报错。。。。。。

我看你们文档说敏感度分析的定义,是按照裁剪某一层的10%,然后直接测试其精度,我这边直接像上面那样配置,如果只裁剪某一个卷积层的比如 conv2d_62.w_0的10%,这样配置。直接在原模型上去测试精度,精度几乎都没了.....

5e7a7617e9440758bd84894b74ef138

python tools/eval.py -c configs/yolov3/yolov3_mobilenet_v3_large_270e_voc.yml --slim_config configs/slim/prune/yolov3_mbv3_prune_fpgm.yml -o weights=yolov3_mobilenet_v3_large_270e_voc.pdparams

from paddleslim.

zzjjay avatar zzjjay commented on May 23, 2024

敏感度分析就是按照示例分析不出来。。。报错。。。。。。

这个报错可以按照上面的修改建议试试呢

直接在原模型上去测试精度,精度几乎都没了.....

可以尝试更换l2-norm指标看看,也可能就是说明该conv比较重要,裁剪容易导致较大精度损失,需要后续重新finetune。

from paddleslim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.