Skip to content

JSONDecodeError #9

@bbloks

Description

@bbloks

Thanks for the interersting guide and repo. I have cloned it and setup a virtualenv with required packages. I am able to run the flask server, however not able to make requests.

When using curl request: curl -X POST -F image=@dog.jpg 'http://localhost:5000/predict', I get the following error:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

And subsequently when running the python simple_request.py I get the following error as an output:

Traceback (most recent call last):
  File "simple_request.py", line 17, in <module>
    r = requests.post(KERAS_REST_API_URL, files=payload).json()
  File "/home/bloks/Projects/Sentriq/simple-keras-rest-api/skra_venv/lib/python3.5/site-packages/requests/models.py", line 896, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python3.5/json/__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

As far as I could find, it may have something to do with a version conflict of some of the packages.

Maybe include a requirements.txt file solves the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions