megvii-research / CADDM

Official implementation of ID-unaware Deepfake Detection Model
Apache License 2.0
146 stars 21 forks source link

jpegpy error #20

Closed anjunzi closed 1 year ago

anjunzi commented 1 year ago

hi,I got some issue. Python 3.10.6. When I imported _jpegpy, i got an error

Traceback (most recent call last):
  File "/home/ap/jpegpy/jpegpy.py", line 6, in <module>
    import _jpegpy
ImportError: /home/ap/jpegpy/_jpegpy.so: undefined symbol: `jpeg_mem_src``

For the make,i can compile the generated so file, but there are warnings

make: pkg-config: No such file or directory make: mdl: No such file or directory make: pkg-config: No such file or directory make: mdl: No such file or directory g++ _jpegpy.cc -o _jpegpy.so -std=c++11 -O3 -UNDEBUG --shared -fPIC In file included from pybind11/pytypes.h:12, from pybind11/cast.h:13, from pybind11/attr.h:13, from pybind11/pybind11.h:36, from _jpegpy.cc:6: pybind11/common.h:393:33: warning: ‘int PyThread_create_key()’ is deprecated [-Wdeprecated-declarations] 393 | decltype(PyThread_create_key()) tstate = 0; // Usually an int but a long on Cygwin64 with Python 3.x | ~~~~~~~^~ In file included from /usr/include/python3.10/Python.h:122, from pybind11/common.h:99, from pybind11/pytypes.h:12, from pybind11/cast.h:13, from pybind11/attr.h:13, from pybind11/pybind11.h:36, from _jpegpy.cc:6: /usr/include/python3.10/pythread.h:108:36: note: declared here 108 | Py_DEPRECATED(3.7) PyAPI_FUNC(int) PyThread_create_key(void); | ^~~~~~~

jinjinw commented 1 year ago

Hi, @anjunzi . It seems that you do not have pkg-config. Try apt-get install pkg-config first. See if it works. Also, we have updated the Makefile for _jpegpy to reduce some warnings. You may update it and make again.