gitanat / simple-ocr-opencv

A simple python OCR engine using opencv
GNU Affero General Public License v3.0
525 stars 175 forks source link

TypeError: int() argument must be a string, a bytes-like object or a number, not 'map' #11

Closed ChernyshovYuriy closed 8 years ago

ChernyshovYuriy commented 8 years ago

I am running "openvc3" branch and trying just to run example.py when getting:

Traceback (most recent call last):
  File "/home/yuriy/development/simple-ocr-opencv/example.py", line 12, in <module>
    ocr.train( ImageFile('digits1') )
  File "/home/yuriy/development/simple-ocr-opencv/files.py", line 61, in __init__
    self.ground.read()
  File "/home/yuriy/development/simple-ocr-opencv/files.py", line 40, in read
    self.classes, self.segments = read_boxfile(self.path)
  File "/home/yuriy/development/simple-ocr-opencv/tesseract_utils.py", line 16, in read_boxfile
    return classes_to_numpy(classes), segments_to_numpy(segments)
  File "/home/yuriy/development/simple-ocr-opencv/segmentation.py", line 23, in segments_to_numpy
    segments = numpy.array(segments, dtype=SEGMENT_DATATYPE, ndmin=2)  # each segment in a row
TypeError: int() argument must be a string, a bytes-like object or a number, not 'map'

I am on Ubuntu 14, 64 bit. OpenCV 3.1.

gitanat commented 8 years ago

Are you trying to run this with python3?

ChernyshovYuriy commented 8 years ago

Ye, I do use Python 3.4. And this is not the only one error, just don't want to set all issues in one ticket.

gitanat commented 8 years ago

That's the issue then, this project is written in python 2. Does that work for you? I think making it run for python3 would not be a huge amount of work, but I don't have any plans for doing that in the near future. I'm happy to accept pull requests, though

ChernyshovYuriy commented 8 years ago

Unfortunately, I don't have Python 2 installed. Thanks anywhere.

gitanat commented 8 years ago

Python 2 is included by default in all linux distributions that I know about - it's definitely there in Ubuntu, up to the current day. You can invoke it just by typing "python" in your shell - it's the "default" version. I'll close this for now