content-engine icon indicating copy to clipboard operation
content-engine copied to clipboard

Error while trying to train

Open MrThiago opened this issue 8 years ago • 5 comments

{"message": "JSON parse error - Expecting property name enclosed in double quotes: line 1 column 2 (char 1)"}

MrThiago avatar May 05 '17 01:05 MrThiago

I have the same issue. As I am using flask for the first time I am not familiar with the error.

akash9182 avatar Jun 29 '17 13:06 akash9182

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"}'

akash9182 avatar Jun 29 '17 14:06 akash9182

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?

Prathima1007799 avatar Feb 13 '18 15:02 Prathima1007799

 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

ly0611 avatar Oct 04 '20 00:10 ly0611

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

ly0611 avatar Oct 04 '20 00:10 ly0611