av-savchenko / face-emotion-recognition

Efficient face emotion recognition in photos and videos
Apache License 2.0
654 stars 124 forks source link

The issue with converting .pt to .onnx. #51

Closed xx674967 closed 2 months ago

xx674967 commented 2 months ago

Hi, excellent work, and thank you for sharing! I have a question regarding converting .pt to .onnx using your convert_pt_to_onnx.py script. I encountered an issue where, despite installing timm==0.4.5, it gives an error stating no timm.layer. I understand this is likely due to the timm version, but updating to a newer version causes other unexpected issues. Do you have any suggestion? thanks

av-savchenko commented 2 months ago

Try timm 0.9.7 and let me back full stack trace if this does not work for you

xx674967 commented 2 months ago

Try timm 0.9.7 and let me back full stack trace if this does not work for you

Thank you for your quickly response. After I changed the timm version to 0.9.7, I encountered this error: RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor. I've tried modifying the input tensor to .cuda(), but the problem persists. Could you please help me find a solution? Thank you very much.

xx674967 commented 2 months ago

I found a fascinating issue: converting to ONNX works fine on Windows, but on Linux, various strange errors occur. I'm not sure of the exact reason. Anyway, I will close this issue.

ceyxasm commented 1 month ago

Worked with timm==0.9.2. Executed flawlessly.