ZhouYanzhao / ORN

Oriented Response Networks, in CVPR 2017
http://yzhou.work/ORN
BSD 3-Clause "New" or "Revised" License
223 stars 51 forks source link

Error in liborn for pytorch branch #14

Open nayeemiiitd opened 6 years ago

nayeemiiitd commented 6 years ago

At first I ran

python3 setup.py install 

which created build, dist and orn.egg-info folders. Inside the build folder there was the orn folder containing _ext which has liborn. But init.py file inside the liborn folder gives reference error on the line :

from ._liborn import lib as _lib, ffi as _ffi
aneesh3108 commented 6 years ago

Hi @nayeemiiitd,

I got a similar error while trying to import the conv2d file - and hence giving a 'possible' solution here - I may be wrong.

Once you execute the setup / bash install.sh, all folders are copied and moved over to your default python site packages directory.

For me, I use anaconda environment and hence it was present at:

*\anaconda3\envs\pyt04\lib\python3.6\site-packages

as

orn-1.0-py3.6-linux-x86_64.egg

Not to waste any time, I changed the name of the directory to orn and then simply imported the function as orn.orn.modules.ORConv. (If you import the folder as a default python import anywhere, it gives an error due to the naming convention. No idea how to change that.)

That works and does not give the error from ._liborn import lib as _lib, ffi as _ffi

Hope this helps!