FelixCaae / AlignDETR

[BMVC 2024] Official implementation of Align-DETR
Apache License 2.0
49 stars 4 forks source link

ImportError: cannot import name 'averaged_loss_on_dataset' from 'detectron2.evaluation' #2

Closed jiongjiongli closed 4 months ago

jiongjiongli commented 1 year ago

May I verify detectron2 commit id? I met with an "ImportError" exception after following the installation steps.

Traceback (most recent call last):
  File "/kaggle/working/AlignDETR/tools/train_net.py", line 33, in <module>
    from detectron2.evaluation import inference_on_dataset, print_csv_format, averaged_loss_on_dataset
ImportError: cannot import name 'averaged_loss_on_dataset' from 'detectron2.evaluation' (/kaggle/working/detrex/detectron2/detectron2/evaluation/__init__.py)

The commit I used is:

ID: 717ab9f
Author: Pyre Bot Jr <>
Date:   Sat Aug 27 23:51:41 2022 -0700

    suppress errors in `vision/fair/detectron2/projects/DensePose`

    Differential Revision: D39086771

    fbshipit-source-id: 330bc13416cd9abe3b879a856ddc5d4a6e8cd319

I searched "averaged_loss_on_dataset" from latest detection2, but didn't find this function as well.

toffeecat commented 1 year ago

I have met the same issue.

harrymagic098 commented 4 months ago

I also found this problem, is there a solution?

FelixCaae commented 4 months ago

Sorry for this problem , I have fixed this issue by removing this import since it is not actually used.