일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- pytorch
- git
- Database
- Package
- KAKAO
- Mac
- GitLab
- Windows
- file
- Python
- judge
- TORCH
- Linux
- Converting
- enV
- CUDA
- numpy
- format
- Paper
- docker
- pandas
- DB
- PostgreSQL
- Flask
- AI
- Laravel
- LLM
- Container
- evaluation
- list
Archives
- Today
- Total
Daily Develope
[Python] ML Flow 정리중 본문
Hosting
1. 서빙
mlflow server --host 127.0.0.1 --port 9090
2. 추적 서버 설정
import mlflow
# Set our tracking server uri for logging
mlflow.set_tracking_uri(uri="http://127.0.0.1:9090")
# Create a new MLflow Experiment
mlflow.set_experiment("MLflow Quickstart")
# with mlflow.start_run():
# 내부 기입되는 mlflow에 대한 로깅
# Log the hyperparameters
mlflow.log_params(params)
# Log the loss metric
mlflow.log_metric("accuracy", accuracy)
# Set a tag that we can use to remind ourselves what this run was for
mlflow.set_tag("Training Info", "Basic LR model for iris data")
# ...
Signature
: 모델의 입/출력 & 파라미터 정보 (template) 정의
(function) def infer_signature(
model_input: Any = None,
model_output: Any = None,
params: dict[str, Any] | None = None
) -> ModelSignature
- 예시 (python 코드 및 정의된 템플릿)
from mlflow.models import infer_signature
infer_signature(model_input={
"long_col": 1,
"str_col": "a",
"bool_col": True
})
# Template (Inferred Signature)
signature:
input: '[
{"name": "long_col", "type": "long", "required": "true"},
{"name": "str_col", "type": "string", "required": "true"},
{"name": "bool_col", "type": "boolean", "required": "true"}
]'
output: null
params: null
'Develope > Python' 카테고리의 다른 글
[Python] UV package management tool (0) | 2025.04.20 |
---|---|
[Tools] uv package management tool on MacOS/Linux (0) | 2025.04.07 |
[Poetry] Poetry 설치 및 기본 명령어 on Mac (2) | 2025.03.05 |
[Python] Install PyTorch & Error Handling on Mac (0) | 2025.02.26 |
[Python] 반올림 (0) | 2024.08.20 |
Comments