FFHT
FFHT copied to clipboard
Python wrapper not working
Hi, I am trying to use FFHT for one of my projects, as it is the fastest library for this purpose. I tried installing it with initially no success. I don't code much in C, and am not particularly familiar with the Python-C API, but after a day of googling I identified the following issues with the Python wrapper:
- Py_InitModule3 seems to be deprecated and one should be using a combination of PyModuleDef and PyModule_Create instead. Okay, I rewrote the relevant parts of the _ffht.c file, and it installs seemingly fine, but
- it seems like there is no return value implemented as the _ffht.c file ends with return Py_BuildValue("");
Again, I'm not really sure whether I am doing something wrong, or the second one is actually an issue. Any help is appreciated
You're using the wrong version of python. This extension only supports Python 2, so I suggest using 2.7. Issue 19 had this problem as well. Perhaps the setup.py script should verify that sys.version_info[0] == 2
so that more people aren't confused with this error message.
Ah, right, that. That's a shame. I would do the porting to Python 3 since it would surely come in handy, but I'm afraid I don't have time to learn about this right now
Your other option is writing a Cython wrapper yourself, which would be quick and easy if you’re familiar with it.
As I would like to use the transform as a Tensorflow op, I decided that I do not need a python function for it, which would kill the point due to the computational overhead caused by having to double wrap with TF. I am planning to write the op for it in C++ instead.
@tgcsaba Do you want to make your tensorflow op public? Or even better, contribute it to the repo?
@ilyaraz Sure. I don't know yet when I will actually get around to it because I also have a master's dissertation to write, but it should happen eventually.