Hydrospheredata / hydro-serving

MLOps Platform
http://docs.hydrosphere.io
Apache License 2.0
271 stars 42 forks source link

Test failed #269

Closed eniola123 closed 3 years ago

eniola123 commented 5 years ago

Test Error

status: 500, error: InternalUncaught, message: UNKNOWN: Exception calling application: module 'func_main' has no attribute 'Predict'

This error occur during application Test.

Here is the code for func_main:

model = joblib.load("LightGBM/model/forecaster.pkl");

def predict(**kwargs):

try:

    input_data = {};

    for key, value in kwargs.items():
        input_data[key] = value.double_val;

    data_frame = pd.DataFrame.from_dict(input_data);
    prediction = model.predict(data_frame).tolist();

    prediction_tensor_shape = hs.TensorShapeProto(dim=[hs.TensorShapeProto.Dim(size=len(prediction))]);
    status_tensor_shape = hs.TensorShapeProto(dim=[hs.TensorShapeProto.Dim(size=1)]);

    status = [b"Ok"];

    return hs.PredictResponse(outputs = {"prediction": hs.TensorProto(dtype = hs.DT_DOUBLE, double_val = prediction, tensor_shape = prediction_tensor_shape), \
        "status": hs.TensorProto(dtype = hs.DT_STRING, string_val = status, tensor_shape = status_tensor_shape)});

except Exception as exception:

    status = [repr(exception).encode("utf-8")]
    prediction = [0.00];

    tensor_shape = hs.TensorShapeProto(dim=[hs.TensorShapeProto.Dim(size=1)]);

    return hs.PredictResponse(outputs = {"prediction": hs.TensorProto(dtype = hs.DT_DOUBLE, double_val = prediction, tensor_shape = tensor_shape), \
        "status": hs.TensorProto(dtype = hs.DT_STRING, string_val = status, tensor_shape = tensor_shape)});
eniola123 commented 5 years ago

https://drive.google.com/file/d/1uqMlfU57tp6JSJidk1qqQZEmUDVJbtXu/view?usp=sharing

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.