问题描述
我正在关注driverless的教程:Driverless AI Standalone Python Scoring Pipeline,您可以在以下链接中查看:
我正在表演:
运行 Python 评分流程 - 推荐
但是,当运行最后一步时:
DRIVERLESS_AI_LICENSE_KEY = "在这里粘贴密钥" SCORING_PIPELINE_INSTALL_DEPENDENCIES = 0 /path/to/your/dai-env.sh ./run_example.sh
出现以下错误:
回溯(最近一次调用最后一次):文件“example.py”,第 7 行,在 从 score_h2oai_experiment_5fd7ff9c_b11a_11eb_b91f_0242ac110002 导入 Scorer 文件 "/usr/local/lib/python3.6/dist-packages/scoring_h2oai_experiment_5fd7ff9c_b11a_11eb_b91f_0242ac110002/init.py",第 1 行,在
from .scorer import Scorer File "/usr/local/lib/python3.6/dist-packages/scoring_h2oai_experiment_5fd7ff9c_b11a_11eb_b91f_0242ac110002/scorer.py",
第 7 行,在
from h2oaicore import application_context
ModuleNotFoundError: 没有名为“h2oaicore”的模块
-- 希望你能帮助我,提前致谢。
解决方法
显然它没有找到您的 h20aicore 模块。导入它的一种蛮力方法可以在您的 python 脚本中执行以下操作:
import sys
import os
sys.path.append(os.path.abspath("path/to/module"))
或者你应该将它添加到你的 python 路径中。
,我同意@BlackPhoenix 的评论。它正在寻找 h2oaicore 模块。 DAI Python 评分管道带有 h2oaicore .whl 文件。查看 shell 脚本 run_example.sh
。它应该包含有关 pip 安装 h2oaicore 的步骤。