Error while trying to train
{"message": "JSON parse error - Expecting property name enclosed in double quotes: line 1 column 2 (char 1)"}
I have the same issue. As I am using flask for the first time I am not familiar with the error.
I resolved this issue There is typo in
curl -X GET -H "X-API-TOKEN: FOOBAR1" -H "Content-Type: application/json; charset=utf-8" http://127.0.0.1:5000/train -d "{"data-url": "sample-data.csv"}"
change to
curl -X GET -H "X-API-TOKEN: FOOBAR1" -H "Content-Type: application/json; charset=utf-8" http://127.0.0.1:5000/train -d '{"data-url": "sample-data.csv"}'
I am getting the 'dict' object is not callable while train and 'list ' object is not callable while predicting. the error looks like the below. app_rv = app(environ, start_response) TypeError: 'dict' object is not callable
complete error
127.0.0.1 - - [13/Feb/2018 20:14:15] "GET /train HTTP/1.1" 500 - Traceback (most recent call last): File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\flask\app.py", line 1997, in call return self.wsgi_app(environ, start_response) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\flask\app.py", line 1985, in wsgi_app response = self.handle_exception(e) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\flask\app.py", line 1540, in handle_exception reraise(exc_type, exc_value, tb) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\flask\app.py", line 1982, in wsgi_app response = self.full_dispatch_request() File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\flask\app.py", line 1615, in full_dispatch_request return self.finalize_request(rv) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\flask\app.py", line 1630, in finalize_request response = self.make_response(rv) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\flask\app.py", line 1740, in make_response rv = self.response_class.force_type(rv, request.environ) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\werkzeug\wrappers.py", line 885, in force_type response = BaseResponse(*_run_wsgi_app(response, environ)) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\werkzeug\wrappers.py", line 57, in _run_wsgi_app return _run_wsgi_app(*args) File "C:\ContentBasedRecommender2\anaconda2\lib\site-packages\werkzeug\test.py", line 884, in run_wsgi_app app_rv = app(environ, start_response) TypeError: 'dict' object is not callable
can anyone help me with this issue?
curl -X GET -H "X-API-TOKEN: FOOBAR1" -H "Content-Type: application/json; charset=utf-8" http://127.0.0.1:5000/train -d '{"data-url": "sample-data.csv"}'
use this : curl -X GET -H "X-API-TOKEN: FOOBAR1" -H "Content-Type: application/json; charset=utf-8" -d "{"data-url": "sample-data.csv"}" http://127.0.0.1:5000/train
curl -X GET -H "X-API-TOKEN: FOOBAR1" -H "Content-Type: application/json; charset=utf-8" -d "{"data-url": "sample-data.csv"}" http://127.0.0.1:5000/train