Skip to content

There was a bug with computing FLOPs in OpenPCdet #114

Open
@M0NSTERCOCO

Description

@M0NSTERCOCO

When I use this function to compute FLOPs in OpenPCdet framework, it didn't work well.

Can I use this function this way?

    macs, params = get_model_complexity_info(model, (1,), as_strings=True,
                                           print_per_layer_stat=False, verbose=True)
    print('{:<30}  {:<8}'.format('Computational complexity: ', macs))
    print('{:<30}  {:<8}'.format('Number of parameters: ', params))
Traceback (most recent call last):
  File "test.py", line 219, in <module>
    main()
  File "test.py", line 209, in main
    stat(model,(3,224,224))
  File "/opt/conda/lib/python3.7/site-packages/torchstat/statistics.py", line 71, in stat
    ms.show_report()
  File "/opt/conda/lib/python3.7/site-packages/torchstat/statistics.py", line 64, in show_report
    collected_nodes = self._analyze_model()
  File "/opt/conda/lib/python3.7/site-packages/torchstat/statistics.py", line 57, in _analyze_model
    model_hook = ModelHook(self._model, self._input_size)
  File "/opt/conda/lib/python3.7/site-packages/torchstat/model_hook.py", line 24, in __init__
    self._model(x)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "../pcdet/models/detectors/IASSD.py", line 13, in forward
    batch_dict = cur_module(batch_dict)
  File "/opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "../pcdet/models/backbones_3d/IASSD_backbone.py", line 143, in forward
    batch_size = batch_dict['batch_size']
IndexError: too many indices for tensor of dimension 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions