facenet-pytorch icon indicating copy to clipboard operation
facenet-pytorch copied to clipboard

ONNX conversion

Open Fritskee opened this issue 2 years ago • 4 comments

Has anybody successfully converted the MTCNN to ONNX? Keep getting the error:

~\Anaconda3\envs\facenet\lib\site-packages\facenet_pytorch\models\utils\detect_face.py in detect_face(imgs, minsize, pnet, rnet, onet, threshold, factor, device)
     81         offset += boxes_scale.shape[0]
     82 
---> 83     boxes = torch.cat(boxes, dim=0)
     84     image_inds = torch.cat(image_inds, dim=0)
     85 

RuntimeError: torch.cat(): expected a non-empty list of Tensors

Fritskee avatar Sep 27 '22 15:09 Fritskee

Any updates?

beybars1 avatar May 11 '23 06:05 beybars1

Please update if it has been solved

chaitanyakkumar avatar May 26 '23 08:05 chaitanyakkumar

You need to use a real image to convert the model (preferably a face), and this error will be reported if you use the data generated by torch.randn

He is right.

beybars1 avatar Aug 09 '23 10:08 beybars1

so in case if the model is not good enough to detect a face it will probably throw this error?

sceddd avatar Aug 03 '24 09:08 sceddd