You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The model is deployed into docker which is from mlflow/examples/sklearn_elasticnet_wine/train.py. Following are details of docker.
docker run -p 5001:8080 "ni"
pip 19.0.3 from /miniconda/lib/python3.7/site-packages/pip (python 3.7)
Python 3.7.3
1.0.0
[2019-07-24 11:55:06 +0000] [44] [INFO] Starting gunicorn 19.9.0
[2019-07-24 11:55:06 +0000] [44] [INFO] Listening at: unix:/tmp/gunicorn.sock (44)
[2019-07-24 11:55:06 +0000] [44] [INFO] Using worker: gevent
[2019-07-24 11:55:06 +0000] [47] [INFO] Booting worker with pid: 47
Inside docker enter data with the following command : curl http://127.0.0.1:8080/invocations -H 'Content-Type: application/json' -d '{ "columns": ["a", "b", "c"], "data": [[1, 2, 3], [4, 5, 6]] }'
Error report: {"error_code": "BAD_REQUEST", "message": "Encountered an unexpected error while evaluating the model. Verify that the serialized input Dataframe is compatible with the model for inference.", "stack_trace": "Traceback (most recent call last):\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/mlflow/pyfunc/scoring_server/__init__.py\", line 196, in transformation\n raw_predictions = model.predict(data)\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/linear_model/base.py\", line 256, in predict\n return self._decision_function(X)\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/linear_model/coordinate_descent.py\", line 791, in _decision_function\n return super(ElasticNet, self)._decision_function(X)\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/linear_model/base.py\", line 241, in _decision_function\n dense_output=True) + self.intercept_\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/utils/extmath.py\", line 140, in safe_sparse_dot\n return np.dot(a, b)\nValueError: shapes (2,3) and (11,) not aligned: 3 (dim 1) != 11 (dim 0)\n"}
The text was updated successfully, but these errors were encountered:
@lyw615 Me too facing the same problem.
Your input is also fine right
curl http://127.0.0.1:8080/invocations -H 'Content-Type: application/json' -d '{ "columns": ["a", "b", "c"], "data": [[1, 2, 3], [4, 5, 6]] }'
How did you fix this? meant what changes you did for the above url?
System information
The model is deployed into docker which is from mlflow/examples/sklearn_elasticnet_wine/train.py. Following are details of docker.
docker run -p 5001:8080 "ni"
pip 19.0.3 from /miniconda/lib/python3.7/site-packages/pip (python 3.7)
Python 3.7.3
1.0.0
[2019-07-24 11:55:06 +0000] [44] [INFO] Starting gunicorn 19.9.0
[2019-07-24 11:55:06 +0000] [44] [INFO] Listening at: unix:/tmp/gunicorn.sock (44)
[2019-07-24 11:55:06 +0000] [44] [INFO] Using worker: gevent
[2019-07-24 11:55:06 +0000] [47] [INFO] Booting worker with pid: 47
127.0.0.1 - - [24/Jul/2019:12:12:51 +0000] "POST /invocations HTTP/1.1" 400 1174 "-" "curl/7.47.0"
Describe the problem
Inside docker enter data with the following command :
curl http://127.0.0.1:8080/invocations -H 'Content-Type: application/json' -d '{ "columns": ["a", "b", "c"], "data": [[1, 2, 3], [4, 5, 6]] }'
Error report:
{"error_code": "BAD_REQUEST", "message": "Encountered an unexpected error while evaluating the model. Verify that the serialized input Dataframe is compatible with the model for inference.", "stack_trace": "Traceback (most recent call last):\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/mlflow/pyfunc/scoring_server/__init__.py\", line 196, in transformation\n raw_predictions = model.predict(data)\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/linear_model/base.py\", line 256, in predict\n return self._decision_function(X)\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/linear_model/coordinate_descent.py\", line 791, in _decision_function\n return super(ElasticNet, self)._decision_function(X)\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/linear_model/base.py\", line 241, in _decision_function\n dense_output=True) + self.intercept_\n File \"/miniconda/envs/custom_env/lib/python3.6/site-packages/sklearn/utils/extmath.py\", line 140, in safe_sparse_dot\n return np.dot(a, b)\nValueError: shapes (2,3) and (11,) not aligned: 3 (dim 1) != 11 (dim 0)\n"}
The text was updated successfully, but these errors were encountered: