pyspark MyStore StoreClient()log_model无法使用mlflow.spark风格运行推理

5cg8jx4n  于 2024-01-06  发布在  Spark
关注(0)|答案(1)|浏览(187)

我使用FeatureStoreClient().log_model(...,flavor = mlflow.spark,...)记录模型,在尝试使用

  1. fs.score_batch(f"models:/{model_name}/Production", batch_scoring)

字符串
在数据块运行时环境中。
在运行批处理推断后,我得到以下错误:

  1. 2023/11/17 20:51:40 WARNING mlflow.pyfunc: Detected one or more mismatches between the model's dependencies and the current Python environment:
  2. - databricks-feature-lookup (current: uninstalled, required: databricks-feature-lookup==0.*)
  3. To fix the mismatches, call `mlflow.pyfunc.get_model_dependencies(model_uri)` to fetch the model's environment and install dependencies using the resulting environment file.
  4. 2023/11/17 20:51:40 WARNING mlflow.pyfunc: Calling `spark_udf()` with `env_manager="local"` does not recreate the same environment that was used during training, which may lead to errors or inaccurate predictions. We recommend specifying `env_manager="conda"`, which automatically recreates the environment that was used to train the model and performs inference in the recreated environment.
  5. PythonException: 'ModuleNotFoundError: No module named 'ml''. Full traceback below:


我不知道该如何解决,任何帮助都将不胜感激。
我一直在. -在log_model中尝试不同的风格-尝试更好地理解mlflow模型风格API

qojgxg4l

qojgxg4l1#

似乎model.predict找不到ml模块。你可以检查你的代码,也许你正在使用自定义模块ml.py(或包),简单搜索导入。自定义代码必须包含在fs.log_model中

相关问题