Wakeupbuddy / amodalAPI

36 stars 5 forks source link

Can't run with Anaconda environment #1

Closed kastnerkyle closed 7 years ago

kastnerkyle commented 7 years ago

The story so far (copied from chat)

I am using anaconda and had to additionally symlink coco/common in amodalApi to get maskApi.h for build_ext to work

it builds but is still unhappy... ImportError: pycocotools/_mask.so: undefined symbol: PyFPE_jbuf investigating now, seems related to numpy versions or somesuch. May be an environment problem.

looks like the cython generated c is referencing system python... /usr/local/lib/python2.7/dist-packages/numpy/core/include . After recreating the cython file, it references the python I expect but it still gives the PyFPE_jbuf error.

Wakeupbuddy commented 7 years ago

Thanks, I am looking now. I saw a similar issue in the cocoApi yesterday: https://github.com/pdollar/coco/issues/35

btw, can you run the original cocoApi in this machine?

kastnerkyle commented 7 years ago

Yes, all is well in the coco api itself with the ipynb examples

kastnerkyle commented 7 years ago

When I run in the terminal (not notebook) I get a different error

python -c 'from pycocotools.amodal import Amodal'

Gives

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/kkastner/anaconda2/lib/python2.7/site-packages/pycocotools/amodal.py", line 58, in <module>
    import mask
  File "/home/kkastner/anaconda2/lib/python2.7/site-packages/pycocotools/mask.py", line 3, in <module>
    import pycocotools._mask as _mask
ImportError: /home/kkastner/anaconda2/lib/python2.7/site-packages/pycocotools/_mask.so: undefined symbol: rleMinus
Wakeupbuddy commented 7 years ago

oh my bad, I modified maskApi.c, but didn't include the code here...

Let me add those modified files.

kastnerkyle commented 7 years ago

It's fixed after your pushed files! Thanks a lot.

Wakeupbuddy commented 7 years ago

np:)

I am still testing the installation on a brand new aws machine. I will need to add a bunch of dependecies in readme.

kastnerkyle commented 7 years ago

I still get errors in jupyter notebook but commandline is fine. It might be in my environment, I will keep looking too :)

Wakeupbuddy commented 7 years ago

can you copy the error log ?

kastnerkyle commented 7 years ago

Here it is, from the notebook

ImportError                          Traceback (most recent call last)
<ipython-input-1-e768b8eb76e4> in <module>()
      1 get_ipython().magic(u'matplotlib inline')
----> 2 from pycocotools.amodal import Amodal
      3 import numpy as np
      4 import skimage.io as io
      5 import matplotlib.pyplot as plt

/home/kkastner/amodalAPI/PythonAPI/pycocotools/amodal.py in <module>()
     56 import copy
     57 import itertools
---> 58 import mask
     59 import os
     60 from pycocotools.coco import COCO

/home/kkastner/amodalAPI/PythonAPI/pycocotools/mask.py in <module>()
      1 __author__ = 'tsungyi'
      2 
----> 3 import pycocotools._mask as _mask
      4 
      5 # Interface for manipulating masks stored in RLE format.

ImportError: pycocotools/_mask.so: undefined symbol: PyFPE_jbuf

On Thu, Jan 26, 2017 at 1:58 PM, Yan Zhu notifications@github.com wrote:

can you copy the error log ?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Wakeupbuddy/amodalAPI/issues/1#issuecomment-275527236, or mute the thread https://github.com/notifications/unsubscribe-auth/ABfbHfNqhmEwZQ_z3iKbvktl6gMwe_cEks5rWRcXgaJpZM4LvI6J .

kastnerkyle commented 7 years ago

I am copy pasting more and more of the notebook into a .py file, and so far it seems fine. So I am unsure what is going on...

Wakeupbuddy commented 7 years ago

unfortunately I cannot reprod this.

After some googling, I am thinking could it because the "pycocotools/_mask.so" is confilcting with your previous installation of cocoAPI?

Maybe try using virtualenv to create a separate python environment?

kastnerkyle commented 7 years ago

OK, so with myAmodalDemo.ipynb in the main dir it is working, other than some tiny path issues (due to copying up one dir). So I am unsure what that error was, beyond (my guess) imports getting confused by a pycocotools in "." and also "~/anaconda2/lib/site-packages/python2.7"

Wakeupbuddy commented 7 years ago

or because your ipython and python are using different environment?

which python which ipython

are they from same path?

kastnerkyle commented 7 years ago

Yes, both from ~/anaconda2/bin

kastnerkyle commented 7 years ago

You can close if you like, I think it is path related due to running jupyter notebook in the PythonAPI dir directly.

Wakeupbuddy commented 7 years ago

okay, feel free to reopen if new error bothers.

I will cleanup the code and enrich readme/installation probably after cvpr rebuttal.

kastnerkyle commented 7 years ago

OK sounds good, thanks again for your help!