aimet icon indicating copy to clipboard operation
aimet copied to clipboard

Unsupported op_type error in YOLOv3 model

Open keisuke-yamano opened this issue 3 years ago • 1 comments

Hi Team,

The following error occurred when applying ChannelPruning to a model in YOLOv3.

2022-07-06 13:01:08,036 - Winnow - ERROR - Unsupported op_type FeatureConcat, dotted Darknet.module_list.3, input_ops: []
Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/.vscode-server/extensions/ms-python.python-2022.8.1/pythonFiles/lib/python/debugpy/__main__.py", line 45, in <module>
    cli.main()
  File "/root/.vscode-server/extensions/ms-python.python-2022.8.1/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
    run()
  File "/root/.vscode-server/extensions/ms-python.python-2022.8.1/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
    runpy.run_path(target_as_str, run_name=compat.force_str("__main__"))
  File "/usr/lib/python3.6/runpy.py", line 263, in run_path
    pkg_name=pkg_name, script_name=fname)
  File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/workspace/pytorch/main.py", line 189, in <module>
    main(opt, device)
  File "/workspace/pytorch/main.py", line 119, in main
    compress_model = compress.channel_pruning_auto_mode(model, (batch_size, 3, imgsz_max, imgsz_max), 0.8, train_data_loader, evaluater.evaluate_model)
  File "/workspace/pytorch/compress.py", line 235, in channel_pruning_auto_mode
    parameters=params)
  File "/usr/local/lib/python3.6/dist-packages/aimet_torch/compress.py", line 113, in compress_model
    compressed_layer_db, stats = algo.compress_model(cost_metric, trainer)
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/compression_algo.py", line 87, in compress_model
    layer_comp_ratio_list, stats = self._comp_ratio_select_algo.select_per_layer_comp_ratios()
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/comp_ratio_select.py", line 222, in select_per_layer_comp_ratios
    eval_scores_dict = self._construct_eval_dict()
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/comp_ratio_select.py", line 213, in _construct_eval_dict
    eval_scores_dict = self._compute_eval_scores_for_all_comp_ratio_candidates()
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/comp_ratio_select.py", line 399, in _compute_eval_scores_for_all_comp_ratio_candidates
    progress_bar, layer)
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/comp_ratio_select.py", line 428, in _compute_layerwise_eval_score_per_comp_ratio_candidate
    trainer=None)
  File "/usr/local/lib/python3.6/dist-packages/aimet_torch/channel_pruning/channel_pruner.py", line 251, in prune_model
    layer_comp_ratio_list, cost_metric, trainer)
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/pruner.py", line 75, in prune_model
    self._prune_layer(layer_db, comp_layer_db, layer, comp_ratio, cost_metric)
  File "/usr/local/lib/python3.6/dist-packages/aimet_torch/channel_pruning/channel_pruner.py", line 218, in _prune_layer
    self._winnow_and_reconstruct_layer(orig_layer_db, comp_layer_db, layer, comp_ratio, True)
  File "/usr/local/lib/python3.6/dist-packages/aimet_torch/channel_pruning/channel_pruner.py", line 180, in _winnow_and_reconstruct_layer
    in_place=True)
  File "/usr/local/lib/python3.6/dist-packages/aimet_torch/winnow/winnow.py", line 70, in winnow_model
    in_place, verbose)
  File "/usr/local/lib/python3.6/dist-packages/aimet_torch/winnow/mask_propagation_winnower.py", line 101, in __init__
    self._mask_propagator = MaskPropagator(self._graph, ModelApi.pytorch)
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/winnow/mask_propagator.py", line 77, in __init__
    self._create_masks()
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/winnow/mask_propagator.py", line 93, in _create_masks
    self._create_masks_for_op_and_all_ancestors(op)
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/winnow/mask_propagator.py", line 118, in _create_masks_for_op_and_all_ancestors
    self._op_to_mask_dict[current_op] = Mask(current_op, self._model_api)
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/winnow/mask.py", line 467, in __init__
    self._set_default_input_output_masks(self._num_in_channels, self._num_out_channels)
  File "/usr/local/lib/python3.6/dist-packages/aimet_common/winnow/mask.py", line 726, in _set_default_input_output_masks
    raise NotImplementedError()
NotImplementedError

About the YOLOv3 model definition, please see blew. https://github.com/ultralytics/yolov3 v8 tags.

Could you help me with resolving this issue?

keisuke-yamano avatar Jul 06 '22 06:07 keisuke-yamano

I have some similar questions, can anyone help me solve them?

1SingleFeng avatar Nov 02 '23 12:11 1SingleFeng