MLflowã®çµ±åUltralytics YOLO
ã¯ããã«
å®éšãã®ã³ã°ã¯ãæ§ã ãªã¡ããªã¯ã¹ããã©ã¡ãŒã¿ãã¢ãŒãã£ãã¡ã¯ãã®è¿œè·¡ãå¯èœã«ãããæ©æ¢°åŠç¿ã¯ãŒã¯ãããŒã®éèŠãªåŽé¢ã§ãããããã¯ãã¢ãã«ã®åçŸæ§ãé«ããåé¡ããããã°ããã¢ãã«ã®ããã©ãŒãã³ã¹ãåäžãããã®ã«åœ¹ç«ã¡ãŸãã UltralyticsYOLOãªã¢ã«ã¿ã€ã ã®ãªããžã§ã¯ãæ€åºæ©èœã§ç¥ãããMLflowã¯ãçŸåšãå®å šãªæ©æ¢°åŠç¿ã©ã€ããµã€ã¯ã«ç®¡çã®ããã®ãªãŒãã³ãœãŒã¹ãã©ãããã©ãŒã ã§ããMLflowãšã®çµ±åãæäŸããŠããŸãã
ãã®ããã¥ã¡ã³ããŒã·ã§ã³ã»ããŒãžã¯ãUltralytics YOLO ãããžã§ã¯ãã®ããã® MLflow ãã®ã³ã°æ©èœã®ã»ããã¢ãããšå©çšã«é¢ããå æ¬çãªã¬ã€ãã§ãã
MLflowãšã¯ïŒ
MLflowã¯ãæ©æ¢°åŠç¿ã®ã©ã€ããµã€ã¯ã«ããšã³ãããŒãšã³ãã§ç®¡çããããã«Databricks瀟ãéçºãããªãŒãã³ãœãŒã¹ã®ãã©ãããã©ãŒã ã§ããå®éšã®è¿œè·¡ãåçŸå¯èœãªå®è¡ãžã®ã³ãŒãã®ããã±ãŒãžåãã¢ãã«ã®å ±æãšãããã€ã®ããã®ããŒã«ãå«ãŸããŠããŸããMLflowã¯ãã©ã®ãããªæ©æ¢°åŠç¿ã©ã€ãã©ãªãããã°ã©ãã³ã°èšèªã§ãåäœããããã«èšèšãããŠããŸãã
ç¹åŸŽ
- ã¡ããªã¯ã¹ã»ãã®ã³ã°ïŒåãšããã¯çµäºæãšãã¬ãŒãã³ã°çµäºæã«ã¡ããªã¯ã¹ããã°ã«èšé²ããŸãã
- ãã©ã¡ãŒã¿ãã°ïŒãã¬ãŒãã³ã°ã§äœ¿çšããããã¹ãŠã®ãã©ã¡ãŒã¿ããã°ã«èšé²ããŸãã
- ææç©ã®ãã°ïŒãã¬ãŒãã³ã°çµäºæã«ãéã¿ãšèšå®ãã¡ã€ã«ãå«ãã¢ãã«ã®ææç©ããã°ã«èšé²ããŸãã
ã»ããã¢ãããšåææ¡ä»¶
MLflowãã€ã³ã¹ããŒã«ãããŠããããšã確èªãããã€ã³ã¹ããŒã«ãããŠããªãå Žåã¯ãpipã䜿çšããŠã€ã³ã¹ããŒã«ããŠãã ããïŒ
Ultralytics ã®èšå®ã§MLflowã®ãã®ã³ã°ãæå¹ã«ãªã£ãŠããããšã確èªããŠãã ãããéåžžããã㯠mflow
ããŒãåç
§ããŠãã ããã èšå® ã®ããŒãžãåç
§ã
Ultralytics MLflowèšå®ã®æŽæ°
Python ã update
ã¡ãœããã settings
ãªããžã§ã¯ãã®èšå®ãå€æŽããŸãïŒ
䜿çšæ¹æ³
ã³ãã³ã
-
ãããžã§ã¯ãåãèšå®ããïŒç°å¢å€æ°ã§ãããžã§ã¯ãåãèšå®ã§ããŸãïŒ
ãŸãã¯
project=<project>
YOLO åŒæ°ã§æå®ãããyolo train project=my_project
. -
ã©ã³åã®èšå®ïŒãããžã§ã¯ãåã®èšå®ãšåæ§ã«ãç°å¢å€æ°ã䜿ã£ãŠã©ã³åãèšå®ããããšãã§ããŸãïŒ
ãŸãã¯
name=<name>
YOLO åŒæ°ã§æå®ãããyolo train project=my_project name=my_name
. -
ããŒã«ã« MLflow ãµãŒããŒãèµ·åããŸãïŒãã©ããã³ã°ãéå§ããã«ã¯
ã§ããŒã«ã«ã»ãµãŒããŒãèµ·åããã http://127.0.0.1:5000 ããã©ã«ãã§ã¯ããã¹ãŠã®mlflowãã°ã¯'runs/mlflow'ãã£ã¬ã¯ããªã«ä¿åãããŸããå¥ã®URIãæå®ããã«ã¯
MLFLOW_TRACKING_URI
ç°å¢å€æ°ã -
MLflow ãµãŒããŒã€ã³ã¹ã¿ã³ã¹ãåæ¢ããŸãïŒå®è¡äžã® MLflow ã€ã³ã¹ã¿ã³ã¹ããã¹ãŠåæ¢ããã«ã¯ã以äžãå®è¡ããŸãïŒ
ãã®ã³ã°
ãã®ã³ã°ã¯ on_pretrain_routine_end
, on_fit_epoch_end
ãã㊠on_train_end
ã³ãŒã«ããã¯é¢æ°ããããã®é¢æ°ã¯ããã¬ãŒãã³ã°ã»ããã»ã¹ã®ããããã®æ®µéã§èªåçã«åŒã³åºããããã©ã¡ãŒã¿ãã¡ããªã¯ã¹ãææç©ã®ãã®ã³ã°ãåŠçããŸãã
äŸ
-
ã«ã¹ã¿ã ã¡ããªã¯ã¹ã®ãã°:ãå€æŽããããšã§ããã°ã«èšé²ããã«ã¹ã¿ã ã¡ããªã¯ã¹ãè¿œå ã§ããŸãã
trainer.metrics
èŸæžåon_fit_epoch_end
ãšåŒã°ããã -
å®éšãèŠã:ãã°ã衚瀺ããã«ã¯ãMLflow ãµãŒããŒïŒé垞㯠http://127.0.0.1:5000)ã§å®éšãéžæããå®è¡ããã
-
ã©ã³ãèŠã:ã©ã³ãšã¯ãå®éšå ã®åã ã®ã¢ãã«ã®ããšã§ããã©ã³ãã¯ãªãã¯ãããšãã¢ããããŒããããã¢ãŒãã£ãã¡ã¯ããã¢ãã«ã®éã¿ãå«ãã©ã³ã®è©³çŽ°ãèŠãããšãã§ããŸãã
MLflowãç¡å¹ã«ãã
MLflowã®ãã®ã³ã°ããªãã«ããã«ã¯
çµè«
MLflow logging integration withUltralytics YOLO ã¯ãæ©æ¢°åŠç¿å®éšã远跡ããåççãªæ¹æ³ãæäŸããŸããããã©ãŒãã³ã¹ã»ã¡ããªã¯ã¹ãç£èŠããææç©ãå¹æçã«ç®¡çããããšã§ãå ç¢ãªã¢ãã«éçºãšãããã€ãæ¯æŽããŸãã詳现ã«ã€ããŠã¯ãMLflow ã®å ¬åŒããã¥ã¡ã³ããåç §ããŠãã ããã
ããããã質å
Ultralytics YOLO ã§MLflowã®ãã®ã³ã°ãèšå®ããã«ã¯ïŒ
Ultralytics YOLO ã§MLflowã®ãã®ã³ã°ãã»ããã¢ããããã«ã¯ããŸãMLflowãã€ã³ã¹ããŒã«ãããŠããããšã確èªããå¿ èŠããããŸããpip ã䜿ã£ãŠã€ã³ã¹ããŒã«ã§ããŸãïŒ
次ã«ãUltralytics ã®èšå®ã§MLflowã®ãã®ã³ã°ãæå¹ã«ããŸãããã㯠mlflow
ããŒã䜿çšããŸãã詳ãã㯠èšå®ã¬ã€ã.
Ultralytics MLflowèšå®ã®æŽæ°
æåŸã«ããã©ããã³ã°çšã«ããŒã«ã«ã®MLflowãµãŒããŒãç«ã¡äžããïŒ
Ultralytics YOLO ã§MLflowã䜿çšããŠãã©ã®ãããªã¡ããªã¯ã¹ããã©ã¡ãŒã¿ããã°ã«èšé²ã§ããŸããïŒ
Ultralytics YOLO MLflowã¯ããã¬ãŒãã³ã°ããã»ã¹å šäœãéããŠãæ§ã ãªã¡ããªã¯ã¹ããã©ã¡ãŒã¿ãææç©ã®ãã®ã³ã°ããµããŒãããŸãïŒ
- ã¡ããªã¯ã¹ã»ãã®ã³ã°ïŒåãšããã¯ã®çµäºæãšãã¬ãŒãã³ã°å®äºæã«ã¡ããªã¯ã¹ã远跡ããŸãã
- ãã©ã¡ãŒã¿ãã°ïŒãã¬ãŒãã³ã°ããã»ã¹ã§äœ¿çšããããã¹ãŠã®ãã©ã¡ãŒã¿ããã°ã«èšé²ããŸãã
- ææç©ãã°ïŒãã¬ãŒãã³ã°åŸã®ãŠã§ã€ããèšå®ãã¡ã€ã«ãªã©ã®ã¢ãã«ææç©ãä¿åããŸãã
ãã詳现ãªæ å ±ã«ã€ããŠã¯ãUltralytics YOLO ãã©ããã³ã°ã»ããã¥ã¡ã³ããã芧ãã ããã
äžåºŠæå¹ã«ããMLflowã®ãã®ã³ã°ãç¡å¹ã«ã§ããŸããïŒ
ã¯ããUltralytics YOLO ã®èšå®ãæŽæ°ããããšã§ãMLflowã®ãã®ã³ã°ãç¡å¹ã«ããããšãã§ããŸãã以äžã¯ãCLI ã䜿ã£ãæ¹æ³ã§ãïŒ
ãããªãã«ã¹ã¿ãã€ãºãèšå®ã®ãªã»ããã«ã€ããŠã¯ãèšå®ã¬ã€ããåç §ããŠãã ããã
Ultralytics YOLO ãã©ããã³ã°ã®ããã® MLflow ãµãŒããŒãéå§ããã³åæ¢ããã«ã¯ã©ãããã°ããã§ããïŒ
Ultralytics YOLO ã§å®éšã远跡ããããã® MLflow ãµãŒããŒãéå§ããã«ã¯ã以äžã®ã³ãã³ãã䜿çšããŸãïŒ
ãã®ã³ãã³ãã¯ãããã©ã«ãã§ã¯http://127.0.0.1:5000ã§ããŒã«ã« ãµãŒããŒãèµ·åããŸããå®è¡äžã® MLflow ãµãŒã㌠ã€ã³ã¹ã¿ã³ã¹ãåæ¢ããå¿ èŠãããå Žåã¯ã次ã®bash ã³ãã³ãã䜿çšããŸãïŒ
ãã®ä»ã®ã³ãã³ããªãã·ã§ã³ã«ã€ããŠã¯ãã³ãã³ãã»ã¯ã·ã§ã³ãåç §ã®ããšã
å®éšè¿œè·¡ã®ããã«MLflowãUltralytics YOLO ãšçµ±åããå©ç¹ã¯äœã§ããïŒ
MLflow ãUltralytics YOLO ãšçµ±åããããšã§ãæ©æ¢°åŠç¿å®éšã管çããäžã§ããã€ãã®å©ç¹ãåŸãããŸãïŒ
- å®éšè¿œè·¡æ©èœã®åŒ·åïŒç°ãªãå®éšãšãã®çµæãç°¡åã«è¿œè·¡ãæ¯èŒã§ããŸãã
- ã¢ãã«ã®åçŸæ§ã®åäžïŒãã¹ãŠã®ãã©ã¡ãŒã¿ãšã¢ãŒããã¡ã¯ããèšé²ããããšã§ãå®éšã®åçŸæ§ã確ä¿ããŸãã
- ããã©ãŒãã³ã¹ã®ã¢ãã¿ãªã³ã°ïŒããã©ãŒãã³ã¹ææšãæç³»åã§å¯èŠåããããŒã¿ã«åºã¥ããŠã¢ãã«æ¹åã®ææ決å®ãè¡ããŸãã
MLflow ã®Ultralytics YOLO ã§ã®ã»ããã¢ãããšæŽ»çšã®è©³çŽ°ã«ã€ããŠã¯ãMLflow Integration forUltralytics YOLO ã®ããã¥ã¡ã³ããåç §ããŠãã ããã