Speed difference between Python and C++

56 views
Skip to first unread message

Sinister MJ

unread,
Sep 13, 2016, 5:11:41 AM9/13/16
to Caffe Users
C++ code: http://pastebin.com/AFezksCY
Python code: http://pastebin.com/HkGFynSW

Both codes have the same output, the same input, but the speed difference is drastic, the whole code needs about 10s in total for Python to run, while my C++ code takes 65s on net.forward() alone.

How does this happen? Its x64 Release mode, with all optimization turned on (CPU_ONLY mode in either case), so I would expect them both to have around the same runtime, yet my C++ is a lot slower.

kyodaisuki

unread,
Jan 16, 2018, 1:41:37 AM1/16/18
to Caffe Users
Hi, Sinister MJ

I have the same problem,and did you solve it ?

thank you.

Sinister MJ於 2016年9月13日星期二 UTC+8下午5時11分41秒寫道:
Reply all
Reply to author
Forward
0 new messages