我正在使用 azure-databricks 筆記本,我已經使用kats庫幾個星期沒有問題,但現在它在 3 天前突然停止作業,本周五(2022 年 11 月 3 日)我無法理解原因。
當我匯入庫或其任何模塊時,會彈出以下錯誤:
ImportError: cannot import name 'outcome_constraint_from_str' from 'ax.service.utils.instantiation' (/databricks/python/lib/python3.7/site-packages/ax/service/utils/instantiation.py)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<command-719456472689071> in <module>
----> 1 import kats
2 dir(kats)
/databricks/python/lib/python3.7/site-packages/kats/__init__.py in <module>
1 from . import consts # noqa
----> 2 from . import utils # noqa
3 from . import detectors # noqa
4 from . import models # noqa
5 from . import tsfeatures # noqa
/databricks/python/lib/python3.7/site-packages/kats/utils/__init__.py in <module>
5 from . import parameter_tuning_utils # noqa
6 from . import simulator # noqa
----> 7 from . import time_series_parameter_tuning # noqa
/databricks/python/lib/python3.7/site-packages/kats/utils/time_series_parameter_tuning.py in <module>
36 from ax.modelbridge.registry import Models
37 from ax.runners.synthetic import SyntheticRunner
---> 38 from ax.service.utils.instantiation import (
39 outcome_constraint_from_str,
40 parameter_from_json,
ImportError: cannot import name 'outcome_constraint_from_str' from 'ax.service.utils.instantiation' (/databricks/python/lib/python3.7/site-packages/ax/service/utils/instantiation.py)
The problem seems to be with one of the dependencies, which like kats is also developed by facebook: ax-platform
I tried reinstalling and upgrading both kats and ax-platform and I cannot understand the reason.
There are no older versions to go back to, but I noticed from their github page that the "outcome_constraint_from_str" function had received some modifications near the date it stopped working.
https://github.com/facebook/Ax/commit/7510bbd90d29702727a6185ad670d5bed2d1f8e5
Could it be just a bug of some new released modification?
uj5u.com熱心網友回復:
我嘗試安裝以前版本的 ax-platform 和正確匯入的 kats。截至今天(2022 年 3 月 14 日),這解決了這個問題:
pip install ax-platform==0.2.3
uj5u.com熱心網友回復:
沒有舊版本可以回傳
Kats 庫有兩個版本。
? Kats 101,Kats 中的基本資料結構和功能
? Kats 20x,高級主題,包括高級預測技術、高級檢測演算法、TsFeatures、元學習、全域模型等。
嘗試安裝以前版本的 Kats 庫,然后您可以嘗試。
參考這個github鏈接
uj5u.com熱心網友回復:
來自https://github.com/facebookresearch/Kats/issues/216的最新答案:
“這是由于最近對 ax-platform 庫的更改將一些 API 移動到了新模塊,最簡單的解決方法是安裝其最新版本 v0.2.4,請參閱此處的 Github 頁面:https ://github.com/facebook /斧頭
我們正在努力發布一個新的 Kats 版本,它將限制 ax 版本為 0.2.4 或更高版本以供將來安裝。此時,如果您愿意,請升級您的 ax 平臺版本并從源代碼安裝 Kats。謝謝。”
但是,@9879ypxkj 提到的 v0.2.4 和 0.2.3 都不適合我。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/443879.html
標籤:python facebook azure-databricks kats
上一篇:XSD中正則運算式的限制基礎
