0
File "<ipython-input-23-e640c8ab269c>", line 1, in <module>
img_lbl, regions= selectivesearch.selectivesearch(img, scale=500, sigma=0.9, min_size=10)
TypeError: 'module' object is not callable

Why am I getting this error? I'm confused.

What do you need to know to answer my question? I trying to run this code

import skimage.data
import selectivesearch
import matplotlib.pyplot as plt
img = skimage.data.astronaut()
img_lbl, regions= selectivesearch.selectivesearch(img, scale=500, sigma=0.9, min_size=10)
regions[:10]
[{'labels': [0.0], 'rect': (0, 0, 15, 24), 'size': 260},
{'labels': [1.0], 'rect': (13, 0, 1, 12), 'size': 23}]

whan i use function selective_search get this error AttributeError: module 'selectivesearch' has no attribute 'selective_search'

Duha Hassan
  • 109
  • 1
  • 6

1 Answers1

0

It looks as if you imported selectivesearch inside you selective search module, and then called it instead of calling a function.

The error says you can't call a module like a function

Israel Unterman
  • 13,158
  • 4
  • 28
  • 35
  • when I use function get this error< AttributeError: module 'selectivesearch' has no attribute 'selective_search' > – Duha Hassan Jan 21 '17 at 18:11