I downloaded dlib and run this :python setup.py install
. But when I run python_examples\train_object_derector.py, it shows:
I have pulled the latest dlib code from github and tried again, but it didn't work.
I also tried to install python interface with : python setup.py install --yes DLIB_JPEG_SUPPORT, it still didn't work.
I have been troubled with this problem for several days and really don't know how to do.
By the way, I run this on windows-64bit platform with 64-bit python.
Do you have any suggestions to solve this problem?
Thanks very much.
I don't know. You probably have a broken copy of libjpeg installed on your system that is confusing cmake since cmake will try to enable jpeg support by default. I'm sure there is something in the cmake output that says what's going on.
Recently, I have encountered this problem, I have resolved, you can try this:
vcpkg install libpng
vcpkg install libjpeg-turbo
vcpkg integrate install
2.open dlib\config.h and add these code
Then python setup.py install
That's not the right way to deal with this. Dlib comes with a copy of libjpeg and libpng and cmake is configured to compile that into dlib if it doesn't find a system install of those libraries it can use. So I don't really understand how you get this error. Something must cause CMake to not try to use libjpeg at all, which is an option you can explicitly set, but the OP didn't mention doing that. Also, if you just force settting DLIB_JPEG_SUPPORT without actually compiling/linking it into the program, which is what you are recommending, you should get undefined symbol errors at link time.
sure, first i try
python setup.py install --yes DLIB_PNG_SUPPORT --yes DLIB_JPEG_SUPPORT
but when i run the example train_shape_predictor.py, i got an error about DLIB_JPEG_SUPPORT ,
maybe cmake bug,it can not add DLIB_JPEG_SUPPORT to the project, and maybe the vcpkg is unuseful.
I cannot but open the dlib\config.h and modify it,and then rebuild it.
when complie i got some undefined symbol warning about DLIB_JPEG_SUPPORT,
but it really compiled and it's work good
The cmake project that builds the python API is in the tools/python folder. You, or someone who has this problem, should build that project outside the python setup.py script so you can see what is happening.
I would do it but I don't have this problem on any of my systems.
I don't know what's going on, i just use VS2015 developer command prompt and cd dlib-19.4 folder.
then python setup.py install --yes DLIB_PNG_SUPPORT --yes DLIB_JPEG_SUPPORT.
then i open dlib-19.4\tools\python\build\dlib_build\dlib.sln found the DLIB_JPEG_SUPPORT not defined but only DLIB_PNG_SUPPORT. this happend on my two computer.
i have no way, so i try modify config.h .
Now the problem is not perfect Solved. I should learn how to use it , thanks,
a very powerful project.