kacperkan / translation-system-application

0 stars 0 forks source link

BytesIO error while trying to deploy #1

Open bhataktiatma opened 6 years ago

bhataktiatma commented 6 years ago

Hi, I was trying to run your code and am getting the following error after installing and running all the dependencies and the python as well as node code via the bash script

ERROR in app: Exception on /echo [GET]
Traceback (most recent call last):
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/flask_restful/__init__.py", line 273, in error_router
    return original_handler(e)
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "main.py", line 47, in echo
    evaluated = evaluate(img_array)
  File "/media/salil007/Titanium/Mumbai-Hackathon-2018/translation-system-application-master/api/pipeline.py", line 70, in evaluate
    sequence = process_json_img_array(json_array)
  File "/media/salil007/Titanium/Mumbai-Hackathon-2018/translation-system-application-master/api/pipeline.py", line 65, in process_json_img_array
    sequence.append(load_img(img_string))
  File "/media/salil007/Titanium/Mumbai-Hackathon-2018/translation-system-application-master/api/pipeline.py", line 56, in load_img
    img = Image.open(buffer)
  File "/home/salil007/anaconda2/lib/python2.7/site-packages/PIL/Image.py", line 2256, in open
    if not isinstance(size, (list, tuple)):
IOError: cannot identify image file <_io.BytesIO object at 0x7f7f95807b90>

`

kacper1095 commented 6 years ago

Hi!

I can see you are using python 2.7. Try switching to python >= 3.5.

kacper1095 commented 6 years ago

I also updated README to clear out the ambiguity about usage and installation. Hope it helps.