Thank you for your quick reply!
After a whole day trying to compile and install opencv but failed, I tried to use conda install for pytorch, opencv and pip install for the package retinanet(https://github.com/NVIDIA/retinanet-examples 10, which contains an pytorch c++ extension).
But the result is the same, undefined symbol: _ZN2cv8fastFreeEPv.
So, I guess, the pytorch, opencv and the extension must all be compiled from source with gcc of the same version?
Also, I am wondering how to check whether my opencv is correctly linked? (When I import cv2 in the python installed with anaconda3, no error occurs.)
Thank you again !