-1

I want to run this code, but get this error (I currently have 0.4.6 version of imutils package installed)

Error:

Traceback (most recent call last):
  File "object_size.py", line 42, in <module>
    cnts = imutils.grab_contours(cnts)
AttributeError: module 'imutils' has no attribute 'grab_contours'
Miki
  • 40,887
  • 13
  • 123
  • 202

2 Answers2

3

grab_contours was added in this commit on 3 December 2018: https://github.com/jrosebr1/imutils/commit/5aae9887df3dcada5f8d8fa6af0df2122ad7aaca

Version 0.4.6 was released on 18 March 2018: https://pypi.org/project/imutils/#history

Your version doesn't have it yet. You need version 0.5.2 (the current latest release).

Run pip install --upgrade imutils to upgrade it, as JacobIRR mentioned in a comment.

mercator
  • 28,290
  • 8
  • 63
  • 72
0

I solved my problem by removing older version of imutil and installed 0.5.2 version of grab_contours from https://pypi.org/project/imutils

Bharathi
  • 1,015
  • 13
  • 41