Skip to content

ImportError: cannot import name 'add_flops_counting_methods' from 'ptflops.flops_counter' #25

@sangjun7997

Description

@sangjun7997

Even though I have installed ptflops using pip, I cannot train by this problem..

~/BtcDet/tools$ python3 train.py --cfg_file ./cfgs/model_configs/btcdet_kitti_car.yaml --output_dir ../output/kitti_car/ --batch_size 2 --gpu_str "0"
Traceback (most recent call last):
File "train.py", line 6, in
from test import repeat_eval_ckpt
File "/home/server10/BtcDet/tools/test.py", line 17, in
from eval_utils import eval_utils as eval_utils
File "/home/server10/BtcDet/tools/eval_utils/eval_utils.py", line 10, in
from ptflops.flops_counter import add_flops_counting_methods
ImportError: cannot import name 'add_flops_counting_methods' from 'ptflops.flops_counter' (/home/server10/.local/lib/python3.8/site-packages/ptflops/flops_counter.py)

How can I handle this error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions