lear-gist-python icon indicating copy to clipboard operation
lear-gist-python copied to clipboard

AttributeError: 'module' object has no attribute 'extract'

Open zqnnn opened this issue 7 years ago • 8 comments

Hello, I got this error. Can you help me to fix it?

/usr/bin/python2.7 /home/zqn/project/0724/gist.py Traceback (most recent call last): File "/home/zqn/project/0724/gist.py", line 1, in import gist File "/home/zqn/project/0724/gist.py", line 8, in descriptors = gist.extract(img) AttributeError: 'module' object has no attribute 'extract'

zqnnn avatar Aug 03 '18 07:08 zqnnn

Hello, sorry for my late reply.

  1. Can you show me full gist.py?
  2. Can you confirm that you completed all the installation steps without any error?
  3. Can you execute the following code and paste the result here?
import gist
print(dir(gist))
print(gist.__file__)

whitphx avatar Aug 26 '18 14:08 whitphx

I got the same error.

Executing the code you provided returns:

print(dir(gist)) ['GistAPI', 'builtins', 'doc', 'file', 'name', 'package', 'path', 'version', 'gist'] print(gist.file) /Users/martinli/anaconda2/lib/python2.7/site-packages/gist/init.pyc

martinli0822 avatar Aug 28 '18 10:08 martinli0822

This is because the gist module you are using is a different one with same name, possibly here: https://pypi.org/project/gist/

Sorry for name collision as lear-gist-python has not been registered to PyPI.

Please uninstall the existing one or edit setup.py in this repo to make it to have different name.

whitphx avatar Aug 29 '18 13:08 whitphx

Thanks a lot, another question, why the gist feature of an image is 960?

zqnnn avatar Oct 10 '18 01:10 zqnnn

@zqnnn Please see here: https://github.com/tuttieee/lear-gist-python/blob/190126a06282bf3b62d2ce044a6daa3db240c1d5/gistmodule.c#L70-L75 The dimension can be different if n_blocks and orientations_per_scale (and n_scale) are changed while these params are fixed in the current version of this repo.

whitphx avatar Oct 14 '18 08:10 whitphx

while these params are fixed in the current version of this repo.

Now gist.extract() can take nblocks and orientations_per_scale arguments. Please see test.py about how to use those arguments.

whitphx avatar Oct 19 '18 06:10 whitphx

This is because the gist module you are using is a different one with same name, possibly here: https://pypi.org/project/gist/

Sorry for name collision as lear-gist-python has not been registered to PyPI.

Please uninstall the existing one or edit setup.py in this repo to make it to have different name.

sorry, i meet the same problemand i still need your help,i haven't understand how to fix this problem.

worksking avatar Mar 13 '19 04:03 worksking

@worksking

Oh, sorry, please ignore this sentence:

edit setup.py in this repo to make it to have different name.

Please just try to uninstall the existing gist module and then install this lear-gist-python again. I mean, first uninstall gist by

$ pip uninstall gist

whitphx avatar Apr 10 '19 16:04 whitphx