{"id":3985,"library":"dvclive","title":"DVCLive","description":"DVCLive is a Python library for logging machine learning metrics and other metadata. It is designed to be fully compatible with DVC (Data Version Control) and stores logged information in simple, human-readable file formats (like .tsv, .json, .yaml) that can be versioned by Git. It provides real-time experiment tracking and integrates with various ML frameworks, helping users maintain reproducible ML workflows. The current version is 3.49.0, and the library is actively developed with frequent releases.","status":"active","version":"3.49.0","language":"python","source_language":"en","source_url":"https://github.com/iterative/dvclive","tags":["MLOps","experiment tracking","metrics","logging","DVC","machine learning","reproducibility"],"install":[{"cmd":"pip install dvclive","lang":"bash","label":"Core library"},{"cmd":"pip install dvclive[sklearn,image,huggingface,lightning,tf,fastai,optuna,xgb,lgbm,mmcv]","lang":"bash","label":"With common ML framework integrations and features"}],"dependencies":[{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false},{"reason":"Optional, but highly recommended for full experiment versioning and visualization capabilities.","package":"dvc","optional":true},{"reason":"Required for `live.log_sklearn_plot()` methods.","package":"scikit-learn","optional":true},{"reason":"Required for `live.log_image()` methods.","package":"Pillow","optional":true},{"reason":"Often used for custom plot generation, though not a direct dependency of `dvclive` itself, `live.log_image` can log matplotlib figures.","package":"matplotlib","optional":true}],"imports":[{"note":"The `dvclive.init()` function was an older pattern. The modern approach is to instantiate and use the `Live` class.","wrong":"import dvclive; dvclive.init()","symbol":"Live","correct":"from dvclive import Live"}],"quickstart":{"code":"import time\nimport random\nfrom dvclive import Live\n\nparams = {\"learning_rate\": 0.002, \"optimizer\": \"Adam\", \"epochs\": 20}\n\nwith Live() as live:\n    # Log parameters\n    for param in params:\n        live.log_param(param, params[param])\n\n    # Simulate training loop\n    offset = random.uniform(0.2, 0.1)\n    for epoch in range(1, params[\"epochs\"]):\n        fuzz = random.uniform(0.01, 0.1)\n        accuracy = 1 - (2 ** -epoch) - fuzz - offset\n        loss = (2 ** -epoch) + fuzz + offset\n\n        # Log metrics for the current step\n        live.log_metric(\"accuracy\", accuracy)\n        live.log_metric(\"loss\", loss)\n        live.next_step()\n        time.sleep(0.05) # Simulate work, shorten for quick demo","lang":"python","description":"This quickstart demonstrates basic logging of parameters and metrics using `dvclive.Live` within a simulated training loop. Metrics and parameters will be saved in the `dvclive` directory, typically as `metrics.json`, `params.yaml`, and time-series `.tsv` files. Running this code multiple times will generate new experiment steps that can be tracked and compared with DVC."},"warnings":[{"fix":"Upgrade DVCLive to version 3.48.3 or newer, or pin `scikit-learn` to a version older than 1.7.","message":"Scikit-learn `probas_pred` argument change (v3.48.3 and `sklearn>=1.7`). Older DVCLive versions with `sklearn` 1.7+ might encounter `TypeError: missing a required argument: 'y_score'` when using `live.log_sklearn_plot()`. DVCLive 3.48.3 fixed this internally, so ensure your `dvclive` is updated if you use newer `sklearn`.","severity":"breaking","affected_versions":"<3.48.3 (with scikit-learn >= 1.7)"},{"fix":"Users relying on Catalyst integration must either pin `dvclive` to a version older than 3.47.0 or migrate their logging setup away from Catalyst's DVCLive callback.","message":"Dropped Catalyst ML framework integration (v3.47.0). Support for the Catalyst ML framework was removed in DVCLive 3.47.0.","severity":"breaking","affected_versions":">=3.47.0"},{"fix":"Always explicitly pass the `matplotlib.figure.Figure` object you intend to log to `live.log_image()` rather than relying on global state.","message":"Matplotlib `Figure` logging behavior change (v3.48.4). Previously, `live.log_image()` with a matplotlib figure might have implicitly logged the most recently active figure. Since 3.48.4, it strictly logs the `matplotlib.figure.Figure` instance explicitly provided as an argument. Make sure to pass the intended figure object.","severity":"gotcha","affected_versions":">=3.48.4"},{"fix":"Configure `dvclive.Live` instances directly in your Python code using its `__init__` parameters. Avoid relying on or defining the `live` section in `dvc.yaml`.","message":"DVC `live` section deprecation in `dvc.yaml` (DVC 3.0 / DVCLive ~3.0). The `live` section for DVCLive configuration in `dvc.yaml` was deprecated and is no longer the primary way to configure DVCLive. Configuration should primarily be done through the Python `Live` API.","severity":"gotcha","affected_versions":"DVCLive versions integrating with DVC 3.0+"},{"fix":"To explicitly save experiments when running within a DVC pipeline, use `dvc exp run` instead of `dvc repro`.","message":"`save_dvc_exp` ignored in `dvc repro`. When `dvclive` runs as part of a `dvc repro` command, the `save_dvc_exp=True` argument to `Live()` is ignored. DVC experiments will not be automatically saved by `dvclive` in this context.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'3.49.0':71 'activ':76 'compat':21 'control':26 'current':68 'data':24 'design':17 'develop':77 'dvc':23,86 'dvclive':1,2 'experi':53,82 'file':36 'format':37 'framework':60 'frequent':79 'fulli':20 'git':47 'help':61 'human':34 'human-read':33 'inform':30 'integr':56 'json':40 'learn':10,88 'librari':6,74 'like':38 'log':8,29,85 'machin':9,87 'maintain':63 'metadata':14 'metric':11,84 'ml':59,65 'mlop':81 'provid':49 'python':5 'readabl':35 'real':51 'real-tim':50 'releas':80 'reproduc':64,89 'simpl':32 'store':28 'time':52 'track':54,83 'tsv':39 'user':62 'various':58 'version':25,45,69 'workflow':66 'yaml':41","created_at":"2026-04-12T03:36:05.242537+00:00","updated_at":"2026-04-16T14:44:18.573458+00:00","problems":[{"fix":"Install the package using pip: `pip install dvclive`","cause":"The dvclive package is not installed in the Python environment where the code is being executed.","error":"ModuleNotFoundError: No module named 'dvclive'"},{"fix":"Update the code to use the current API for setting the step, which is `live.step = <step_number>`.","cause":"The code is attempting to use a deprecated or changed method (`set_step`) from an older DVCLive API version with a newer installed version of the library.","error":"AttributeError: 'Live' object has no attribute 'set_step'"},{"fix":"Ensure that all specified paths (for outputs, artifacts, or DVC-tracked data) are correct and accessible, run `dvc pull` to retrieve data if necessary, and verify DVC cache integrity.","cause":"This error often occurs when DVCLive or DVC (which DVCLive integrates with) cannot find specified output directories, cache files, or data files, or if DVC's cache is not correctly linked or pulled.","error":"FileNotFoundError: [Errno 2] No such file or directory"},{"fix":"Investigate if other libraries are redirecting or closing standard I/O streams; ensure these streams remain open during DVCLive operations or try to isolate the DVCLive logging from the conflicting library's initialization.","cause":"When using `live.log_artifact()` or other logging functions, certain integrations (e.g., with TensorFlow) might cause standard I/O streams (`stderr` or `stdout`) to be unexpectedly closed, leading to this error during subsequent I/O operations by DVCLive.","error":"ValueError: I/O operation on closed file."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.49.1","cli_name":"dvclive","cli_version":"sh: 1: dvclive: not found","type":"library","homepage":"https://dvc.org/doc/dvclive","github":"https://github.com/iterative/dvclive","docs":"https://dvc.org/doc/dvclive","changelog":"https://github.com/iterative/dvclive/releases","pypi":"https://pypi.org/project/dvclive/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml","data","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-29","next_check":"2026-07-28","install_tag":null}}