Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • models
  • Issue
  • #3001

M
models
  • 项目概览

PaddlePaddle / models
接近 2 年 前同步成功

通知 230
Star 6828
Fork 2962
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 602
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 255
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
M
models
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 602
    • Issue 602
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 255
    • 合并请求 255
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 8月 01, 2019 by saxon_zh@saxon_zhGuest

PaddleSlim剪切报错 pruner.py 维度上的index报错

Created by: universea

配置文件如下 version: 1.0 pruners: pruner_1: class: 'StructurePruner' pruning_axis: '': 0 criterions: '': 'l1_norm' strategies: uniform_pruning_strategy: class: 'UniformPruneStrategy' pruner: 'pruner_1' start_epoch: 0 target_ratio: 0.5 pruned_params: 'conv.*w_0' metric_name: 'map' quantization_strategy: class: 'QuantizationStrategy' start_epoch: 10 end_epoch: 14 float_model_save_path: './output/float' mobile_model_save_path: './output/mobile' int8_model_save_path: './output/int8' weight_bits: 8 activation_bits: 8 weight_quantize_type: 'abs_max' activation_quantize_type: 'abs_max' compressor: epoch: 15 #init_model: './checkpoints/0' # Please enable this option for loading checkpoint. checkpoint_path: './checkpoint/' strategies: - uniform_pruning_strategy - quantization_strategy 报错如下 2019-08-01 20:44:03,772-INFO: _get_best_ratios 2019-08-01 20:44:03,772-INFO: _get_best_ratios Traceback (most recent call last): File "/opt/conda/envs/python35-paddle120-env/lib/python3.5/site-packages/paddle/fluid/contrib/slim/core/compressor.py", line 534, in run strategy.on_epoch_begin(context) File "/opt/conda/envs/python35-paddle120-env/lib/python3.5/site-packages/paddle/fluid/contrib/slim/prune/prune_strategy.py", line 640, in on_epoch_begin params, ratios = self._get_best_ratios(context) File "/opt/conda/envs/python35-paddle120-env/lib/python3.5/site-packages/paddle/fluid/contrib/slim/prune/prune_strategy.py", line 618, in _get_best_ratios param_shape_backup=param_shape_backup) File "/opt/conda/envs/python35-paddle120-env/lib/python3.5/site-packages/paddle/fluid/contrib/slim/prune/prune_strategy.py", line 477, in _prune_parameters param_shape_backup=param_shape_backup) File "/opt/conda/envs/python35-paddle120-env/lib/python3.5/site-packages/paddle/fluid/contrib/slim/prune/prune_strategy.py", line 322, in _forward_pruning_ralated_params param_shape_backup=param_shape_backup) File "/opt/conda/envs/python35-paddle120-env/lib/python3.5/site-packages/paddle/fluid/contrib/slim/prune/prune_strategy.py", line 159, in _prune_parameter_by_idx np.array(param_t), pruned_idx, pruned_axis, lazy=lazy) File "/opt/conda/envs/python35-paddle120-env/lib/python3.5/site-packages/paddle/fluid/contrib/slim/prune/pruner.py", line 95, in prune_tensor mask[pruned_idx] = True IndexError: index 513 is out of bounds for axis 0 with size 512 2019-08-01 20:44:03,957-ERROR: None 2019-08-01 20:44:03,957-ERROR: None 2019-08-01 20:44:03,979-WARNING: You can try our memory optimize feature to save your memory usage: # create a build_strategy variable to set memory optimize option build_strategy = compiler.BuildStrategy() build_strategy.enable_inplace = True build_strategy.memory_optimize = True

     # pass the build_strategy to with_data_parallel API
     compiled_prog = compiler.CompiledProgram(main).with_data_parallel(
         loss_name=loss.name, build_strategy=build_strategy)
  
 !!! Memory optimize is our experimental feature !!!
     some variables may be removed/reused internal to save memory usage, 
     in order to fetch the right value of the fetch_list, please set the 
     persistable property to true for each variable in fetch_list

     # Sample
     conv1 = fluid.layers.conv2d(data, 4, 5, 1, act=None) 
     # if you need to fetch conv1, then:
     conv1.persistable = True
指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/models#3001
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7