timesler / facenet-pytorch

Pretrained Pytorch face detection (MTCNN) and facial recognition (InceptionResnet) models
MIT License
4.61k stars 961 forks source link

mtcnn detect face error #128

Open yueyihua opened 4 years ago

yueyihua commented 4 years ago
Running on device: cpu
/root/.cache/torch
Traceback (most recent call last):
  File "mytest.py", line 33, in <module>
    x_aligned, prob = mtcnn(x, return_prob=True)
  File "/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/facenet_pytorch/models/mtcnn.py", line 258, in forward
    batch_boxes, batch_probs, batch_points = self.detect(img, landmarks=True)
  File "/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/facenet_pytorch/models/mtcnn.py", line 317, in detect
    self.device
  File "/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/facenet_pytorch/models/utils/detect_face.py", line 79, in detect_face
    pick = batched_nms(boxes_scale[:, :4], boxes_scale[:, 4], image_inds_scale, 0.5)
  File "/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/torchvision/ops/boxes.py", line 72, in batched_nms
    keep = nms(boxes_for_nms, scores, iou_threshold)
  File "/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/torchvision/ops/boxes.py", line 32, in nms
    _C = _lazy_import()
  File "/usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/torchvision/extension.py", line 12, in _lazy_import
    from torchvision import _C as C
ImportError: /usr/local/anaconda3/envs/pytorch/lib/python3.6/site-packages/torchvision/_C.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN3c107Warning4warnENS_14SourceLocationESs
timesler commented 4 years ago

@yueyihua can you let us know what versions are you using for:

yueyihua commented 4 years ago

@timesler the versions are as follows: facenet-pytorch: 2.5.0 pytorch: 1.3.1 torchvision: 0.4.2 python: 3.6.9