扫二维码与项目经理沟通
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流
这篇“mlflow升级的方法是什么”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“mlflow升级的方法是什么”文章吧。
10多年的龙潭网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。营销型网站建设的优势是能够根据用户设备显示端的尺寸不同,自动调整龙潭建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。成都创新互联公司从事“龙潭网站设计”,“龙潭网站推广”以来,每个客户项目都认真落实执行。
参照之前mlflow的搭建使用 ,我们先建立mlflow 1.4.0 和mlflow 1.11.0的conda环境
假设你已经建立好了对应的conda环境,且分别为mlflow-1.4.0 和mlflow-1.11.0 则执行:
conda activate mlflow-1.11.0
参考mlflow db upgrade ,执行
mlflow db upgrade MySQL://user:passwd@host:port/db 如:mlflow db upgrade mysql://root:root@localhost/mlflow
其中
名词 | 解释 |
---|---|
user | 数据库的用户名 |
passwd | 数据库的密码 |
host | 数据库的主机地址 |
port | 数据库的端口,如默认为3306则可以省略 |
db | 数据库的database |
如果执行成功则会看到如下输出信息:
2020/11/02 10:24:50 INFO mlflow.store.db.utils: Updating database tables INFO [alembic.runtime.migration] Context impl MySQLImpl. INFO [alembic.runtime.migration] Will assume non-transactional DDL. INFO [alembic.runtime.migration] Running upgrade 2b4d017a5e9b -> cfd24bdc0731, Update run status constraint with killed INFO [alembic.runtime.migration] Running upgrade cfd24bdc0731 -> 0a8213491aaa, drop_duplicate_killed_constraint WARNI [0a8213491aaa_drop_duplicate_killed_constraint_py] Failed to drop check constraint. Dropping check constraints may not be supported by your SQL database. Exception content: (MySQLdb._exceptions.ProgrammingError) (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CHECK status' at line 1") [SQL: ALTER TABLE runs DROP CHECK status] (Background on this error at: http://sqlalche.me/e/f405) INFO [alembic.runtime.migration] Running upgrade 0a8213491aaa -> 728d730b5ebd, add registered model tags table INFO [alembic.runtime.migration] Running upgrade 728d730b5ebd -> 27a6a02d2cf1, add model version tags table INFO [alembic.runtime.migration] Running upgrade 27a6a02d2cf1 -> 84291f40a231, add run_link to model_version
如果此时再在mlflow 1.4.0的环境下 再执行:
mlflow server \ --backend-store-uri mysql://root:root@localhost/mlflow \ --host 0.0.0.0 -p 5002 \ --default-artifact-root s3://mlflow
就会报错:
2020/11/02 10:25:41 ERROR mlflow.cli: Error initializing backend store 2020/11/02 10:25:41 ERROR mlflow.cli: Detected out-of-date database schema (found version 84291f40a231, but expected 2b4d017a5e9b). Take a backup of your database, then run 'mlflow db upgrade' to migrate your database to the latest schema. NOTE: schema migration may result in database downtime - please consult your database's documentation for more detail. Traceback (most recent call last): File "/Users/ljh/opt/miniconda3/envs/mlflow-1.4.0-dev/lib/python3.6/site-packages/mlflow/cli.py", line 263, in server initialize_backend_stores(backend_store_uri, default_artifact_root) File "/Users/ljh/opt/miniconda3/envs/mlflow-1.4.0-dev/lib/python3.6/site-packages/mlflow/server/handlers.py", line 97, in initialize_backend_stores _get_tracking_store(backend_store_uri, default_artifact_root) File "/Users/ljh/opt/miniconda3/envs/mlflow-1.4.0-dev/lib/python3.6/site-packages/mlflow/server/handlers.py", line 83, in _get_tracking_store _tracking_store = _tracking_store_registry.get_store(store_uri, artifact_root) File "/Users/ljh/opt/miniconda3/envs/mlflow-1.4.0-dev/lib/python3.6/site-packages/mlflow/tracking/_tracking_service/registry.py", line 37, in get_store return builder(store_uri=store_uri, artifact_uri=artifact_uri) File "/Users/ljh/opt/miniconda3/envs/mlflow-1.4.0-dev/lib/python3.6/site-packages/mlflow/server/handlers.py", line 54, in _get_sqlalchemy_store return SqlAlchemyStore(store_uri, artifact_uri) File "/Users/ljh/opt/miniconda3/envs/mlflow-1.4.0-dev/lib/python3.6/site-packages/mlflow/store/tracking/sqlalchemy_store.py", line 99, in __init__ mlflow.store.db.utils._verify_schema(self.engine) File "/Users/ljh/opt/miniconda3/envs/mlflow-1.4.0-dev/lib/python3.6/site-packages/mlflow/store/db/utils.py", line 52, in _verify_schema "more detail." % (current_rev, head_revision)) mlflow.exceptions.MlflowException: Detected out-of-date database schema (found version 84291f40a231, but expected 2b4d017a5e9b). Take a backup of your database, then run 'mlflow db upgrade ' to migrate your database to the latest schema. NOTE: schema migration may result in database downtime - please consult your database's documentation for more detail.
这说明升级成功
此时再在mlflow 1.11.0的conda环境下执行:
mlflow server \ --backend-store-uri mysql://root:root@localhost/mlflow \ --host 0.0.0.0 -p 5003 \ --default-artifact-root s3://mlflow
就能正常的看到页面,这样mlflow 从1.4.0到1.11.0的升级就完成了
如果是线上操作,则先备份数据库,因为该升级不一定能保证升级成功,如升级失败,直接从备份数据库恢复或者参照失败处理进行处理
以上就是关于“mlflow升级的方法是什么”这篇文章的内容,相信大家都有了一定的了解,希望小编分享的内容对大家有帮助,若想了解更多相关的知识内容,请关注创新互联行业资讯频道。
我们在微信上24小时期待你的声音
解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流