noahgift / flask-ml-azure-serverless

Deploy Flask Machine Learning Application on Azure App Services
99 stars 199 forks source link

Libraries Versions #8

Open vad2der opened 1 year ago

vad2der commented 1 year ago

Problems encountered while doing lab via Coursera:

  1. Flask version 1.0.2 raises Jinja2 error. ImportError: cannot import name 'Markup' from 'jinja2' (/home/coder/project/VENV/lib/python3.8/site-packages/jinja2/__init__.py) Updating to version 2.2.2 resolves the issue.

  2. Numpy installed by default is 1.24.1, which raises: AttributeError: module 'numpy' has no attribute 'float' on joblib.load(file_name) call. Preinstalling numpy==1.23 resolves the issue.

  3. prediction = list(clf.predict(scaled_payload)) on line 71 raises

    raw_predictions = self.loss_.get_init_raw_predictions(
    AttributeError: 'LeastSquaresError' object has no attribute 'get_init_raw_predictions'

    Which can be resolved by downgrading scikit-learn to 0.20.3, but python3.8 + updated pip does not support installing it.

So, there is an open question about resolving it: use the latest versions and update the code (imports and logic would be different) or use previous Python versions.