FaceDetection-DSFD icon indicating copy to clipboard operation
FaceDetection-DSFD copied to clipboard

ImportError: cannot import name 'pa_sfd_match'

Open ncthong opened this issue 5 years ago • 6 comments

Hi Team, I tried to follow your doc: https://github.com/Tencent/FaceDetection-DSFD and when i run demo.py and got the following error: Traceback (most recent call last): File "demo.py", line 27, in from face_ssd import build_ssd File "D:\TRI TUE NHAN TAO AI\FaceDetection-DSFD-master\face_ssd.py", line 13, in from layers import * File "D:\TRI TUE NHAN TAO AI\FaceDetection-DSFD-master\layers_init_.py", line 2, in from .modules import * File "D:\TRI TUE NHAN TAO AI\FaceDetection-DSFD-master\layers\modules_init_.py", line 2, in from .multibox_loss import MultiBoxLoss, focalLoss File "D:\TRI TUE NHAN TAO AI\FaceDetection-DSFD-master\layers\modules\multibox_loss.py", line 13, in from ..box_utils import (log_sum_exp, match, pa_sfd_match, refine_match, ImportError: cannot import name 'pa_sfd_match'

I've installed torch

ncthong avatar Jun 22 '20 13:06 ncthong

I am also having the same issue. Please let me know if you figured it out.

anilrgukt avatar Jun 22 '20 20:06 anilrgukt

Hi all, I am facing the same error. Could you please share a solution if you had an answer.

Thank you very much

HMAA avatar Jul 03 '20 12:07 HMAA

I found the issue, go to multibox_loss where the library was imported and just remove the pa_sfd_match from the line from ..box_utils import (log_sum_exp, match, pa_sfd_match, refine_match, where it is imported because it does not seem to be used and does not exist in boxutils. Everything then works for me without error

hypadr1v3 avatar Jul 04 '20 07:07 hypadr1v3

This issue may be closed now as I believe the problem has been solved @ncthong

hypadr1v3 avatar Jul 16 '20 07:07 hypadr1v3

thanks guys, I have solved the problem in the way of @hypadr1v3.

ncthong avatar Jul 28 '20 01:07 ncthong

You are very welcome. Although it is strange that this function is not called or mentioned anywhere else apart from the import statement.

hypadr1v3 avatar Jul 28 '20 09:07 hypadr1v3