thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

Unresolved import error when embeding darkflow in C++ #1173

Open JABBeeson opened 4 years ago

JABBeeson commented 4 years ago

Hello,

Ive been trying to embed darkflow into C++ but i get stuck with importing because the following retruns NULL.


pModule = PyImport_Import(pName);

The traceback leaves a bread crum trail pointing to an unresolved import originating at:

tensorflow-core\init.py, line 34:

from tensorflow.python import pywrap_tensorflow

The python works when called independently but when it is called through the C++ handler, it crashes at this point.

The specified dir is listed in the C++ project's Additional Include Directories & in the python embeder's system path:

PyList_Append(path, Pyunicode_FromString("D:\\...\\tensorflow-2.0.0\\")

I know the file exists in tensorflow-2.0.0\python\ as stated in init.py and it's directory should be getting checked.

Has anyone else had this problem?