Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 13951

ModuleNotFoundError: No module named 'sklearn.ensemble._gb_losses'

$
0
0

i have install the scikit_learn and tried to install multiple version but not able to download

not able to find answer for sklearn.ensemble._gb_losses

from flask import Flask, render_template, requestimport pickleimport numpy as npmodel = pickle.load(open("model.pkl", "rb"))app = Flask(__name__)Model = pickle.load(model)@app.route('/')def index():    return render_template("index.html")@app.route("/predict", methods=["POST"])def predict_crop():    n = float(request.form.get('Nitrogen'))    p = float(request.form.get('Phosphorus'))    k = float(request.form.get('Potassium'))    r = float(request.form.get('Rainfall'))    # predict    result = model.predict(np.array([n, p, k, r]).reshape(1, 4))    return resultif __name__ == '__main__':    app.run(debug=True)

this is my code i have added the pkl file

model = pickle.load(open("model.pkl", "rb"))        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

ModuleNotFoundError:

No module named'sklearn.ensemble._gb_losses'

i think its mostly with the problem with versioning of library or it could be the problem with my model


Viewing all articles
Browse latest Browse all 13951

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>