diff --git a/content/docs/command-reference/metrics/index.md b/content/docs/command-reference/metrics/index.md index ea7d743b78..2648f05e99 100644 --- a/content/docs/command-reference/metrics/index.md +++ b/content/docs/command-reference/metrics/index.md @@ -105,11 +105,11 @@ like: } ``` -It will also generate `dvclive/dvc.yaml`, which includes: +It will also generate `dvc.yaml`, which includes: ```yaml metrics: - - metrics.json + - dvclive/metrics.json ``` Now let's print metrics values that we are tracking in this diff --git a/content/docs/dvclive/how-it-works.md b/content/docs/dvclive/how-it-works.md index 8ceb1890cb..8172cc1512 100644 --- a/content/docs/dvclive/how-it-works.md +++ b/content/docs/dvclive/how-it-works.md @@ -16,11 +16,11 @@ The contents of the directory will depend on the methods used: | `Live.log_param()` | `dvclive/params.yaml` | | `Live.log_plot()` | `dvclive/plots/custom` | | `Live.log_sklearn_plot()` | `dvclive/plots/sklearn` | -| `Live.make_dvcyaml()` | `dvclive/dvc.yaml` | +| `Live.make_dvcyaml()` | `dvc.yaml` | | `Live.make_report()` | `dvclive/report.{md/html}` | | `Live.make_summary()` | `dvclive/metrics.json` | -| `Live.next_step()` | `dvclive/dvc.yaml`
`dvclive/metrics.json`
`dvclive/report.{md/html}` | -| `Live.end()` | `dvclive/dvc.yaml`
`dvclive/metrics.json`
`dvclive/report.{md/html}` | +| `Live.next_step()` | `dvc.yaml`
`dvclive/metrics.json`
`dvclive/report.{md/html}` | +| `Live.end()` | `dvc.yaml`
`dvclive/metrics.json`
`dvclive/report.{md/html}` | ### Example @@ -35,7 +35,7 @@ from PIL import Image EPOCHS = 2 -with Live(save_dvc_exp=True) as live: +with Live(report="notebook") as live: live.log_param("epochs", EPOCHS) for i in range(EPOCHS): @@ -54,8 +54,8 @@ with Live(save_dvc_exp=True) as live: The resulting structure will be: ``` +dvc.yaml dvclive -├── dvc.yaml ├── metrics.json ├── params.yaml ├── plots @@ -69,7 +69,7 @@ dvclive │   │   └── metric.tsv │   └── sklearn │   └── confusion_matrix.json -└── report.html +└── report.md model.pt model.pt.dvc ``` @@ -86,11 +86,11 @@ experiment tracker. DVCLive relies on Git to track the [directory] it generates, so it will save each run to the same path and overwrite the results each time. DVCLive uses Git to manage results, code changes, and data changes -([with DVC](#track-large-artifacts-with-dvc)). Include -[`save_dvc_exp=True`](/doc/dvclive/live#parameters) to auto-track as a DVC -experiment so you don't need to worry about manually making Git commits -or branches for each experiment. You can recover them using `dvc exp` commands -or using Git. +([with DVC](#track-large-artifacts-with-dvc)). + +By default, DVCLive will save a DVC experiment so you don't need to +worry about manually making Git commits or branches for each experiment. You can +recover them using `dvc exp` commands or using Git. ### Track large artifacts with DVC @@ -109,13 +109,11 @@ with Git, in which case you can use ## Setup to Run with DVC -DVCLive by default [generates] its own `dvc.yaml` file to configure the -experiment results, but you can create your own `dvc.yaml` file at the base of -your repository (or elsewhere) to define a [pipeline](#setup-to-run-with-dvc) to -run experiments with DVC or +You can create or modify the `dvc.yaml` file at the base of your repository (or +elsewhere) to define a [pipeline](#setup-to-run-with-dvc) to run experiments +with DVC or [customize plots](/doc/user-guide/experiment-management/visualizing-plots#defining-plots). -Do not reuse the DVCLive `dvc.yaml` file since it gets overwritten during each -experiment run. A pipeline stage for model training might look like: +A pipeline stage for model training might look like: ```yaml stages: @@ -152,13 +150,6 @@ downstream in your pipeline. For example, to cache all DVCLive plots: + - dvclive/plots ``` - - -Do not add the entire DVCLive [directory] since DVC does not expect the DVCLive -`dvc.yaml` file to be inside the [outputs]. - - - [directory]: /doc/dvclive/how-it-works#directory-structure [cache]: /doc/start/data-management/data-versioning [outputs]: /doc/user-guide/pipelines/defining-pipelines#outputs diff --git a/content/docs/dvclive/index.md b/content/docs/dvclive/index.md index 96f2c66e94..8149440da7 100644 --- a/content/docs/dvclive/index.md +++ b/content/docs/dvclive/index.md @@ -19,18 +19,11 @@ can jump directly to its corresponding page. ### Initialize DVCLive ```python -with Live(save_dvc_exp=True) as live: +with Live() as live: ``` See [`Live()`](/doc/dvclive/live) for details. - - -Including `save_dvc_exp=True` will automatically -[track the results](/doc/dvclive/how-it-works#git-integration). - - - ### Log data @@ -120,6 +113,8 @@ See `Live.next_step()`. Under the hood, `Live.next_step()` calls `Live.make_summary()`, `Live.make_dvcyaml()`, and `Live.make_report()`. +When access is enabled, updates will be sent to DVC Studio. + If you want to decouple the `step` update from the rest of the calls, you can manually modify the `Live.step` property and call `Live.make_summary()` / `Live.make_dvcyaml()` / `Live.make_report()`. @@ -133,7 +128,7 @@ Joining the above snippets, you can include DVCLive in your training code: from dvclive import Live -with Live(save_dvc_exp=True) as live: +with Live() as live: live.log_param("epochs", NUM_EPOCHS) diff --git a/content/docs/dvclive/live/end.md b/content/docs/dvclive/live/end.md index f8118e5bc9..e9df2b0f14 100644 --- a/content/docs/dvclive/live/end.md +++ b/content/docs/dvclive/live/end.md @@ -37,7 +37,7 @@ model.fit( By default, `Live.end()` will call `Live.make_summary()`, `Live.make_dvcyaml()`, and `Live.make_report()`. -If `save_dvc_exp=True` has been passed to `Live`, it will +If `save_dvc_exp=True`, it will [save a new DVC experiment](/doc/dvclive/how-it-works#git-integration) and write a `dvc.yaml` file configuring what DVC will show for logged plots, metrics, and parameters. diff --git a/content/docs/dvclive/live/index.md b/content/docs/dvclive/live/index.md index 2858c39e83..2ebcceea0e 100644 --- a/content/docs/dvclive/live/index.md +++ b/content/docs/dvclive/live/index.md @@ -9,8 +9,8 @@ class Live: self, dir: str = "dvclive", resume: bool = False, - report: Optional[str] = "auto", - save_dvc_exp: bool = False, + report: Optional[str] = None, + save_dvc_exp: bool = True, dvcyaml: bool = True, exp_message: Optional[str] = None, ): @@ -49,7 +49,7 @@ You can use `Live()` as a context manager. When exiting the context manager, - `dir` - Location of the directory to store [outputs](/doc/dvclive/how-it-works). -- `dvc_file` - `{Live.dir}/dvc.yaml`. +- `dvc_file` - Path for `dvc.yaml` file. - `metrics_file` - `{Live.dir}/metrics.json`. @@ -68,30 +68,27 @@ You can use `Live()` as a context manager. When exiting the context manager, - `resume` - If `True`, DVCLive will try to read the previous `step` from the `metrics_file` and start from that point. Defaults to `False`. -- `report` - Any of `auto`, `html`, `notebook`, `md` or `None`. See - `Live.make_report()`. +- `report` - Any of `html`, `notebook`, `md` or `None`. See + `Live.make_report()`. Defaults to `None`. - The `auto` mode (default) will use `md` format if the `CI` env var is present - and [matplotlib](https://matplotlib.org/) is installed and `html` otherwise. - - If `report` is `None`, `Live.make_report()` won't generate anything. - -- `save_dvc_exp` - If `True`, DVCLive will create a new +- `save_dvc_exp` - If `True` , DVCLive will create a new [DVC experiment](/doc/dvclive/how-it-works#git-integration) as part of - `Live.end()`. Defaults to `False`. + `Live.end()`. Defaults to `True`. -- `dvcyaml` - If `True`, DVCLive will write - [DVC configuration](/doc/user-guide/project-structure/dvcyaml-files) for - metrics, plots, and parameters to - [`Live.dvc_file`](/doc/dvclive/live#properties) as part of `Live.next_step()` - and `Live.end()`. See `Live.make_dvcyaml()`. Defaults to `True`. + If you are using DVCLive inside a DVC Pipeline and running with + `dvc exp run`, the option will be ignored. - +- `dvcyaml` - If `True` (default), DVCLive will write + [DVC configuration](/doc/user-guide/project-structure/dvcyaml-files) for + metrics, plots, and parameters to `dvc.yaml` (at the root of the repository) + as part of `Live.next_step()` and `Live.end()`. See `Live.make_dvcyaml()`. - If you are already tracking DVCLive metrics, plots, and parameters in your own - `dvc.yaml` file, set `dvcyaml=False` to avoid duplication. + If a string like `subdir/dvc.yaml`, DVCLive will write the configuration to + that path (file must be named `dvc.yaml`). - + If `False`, DVCLive will not write to `dvc.yaml` (useful if you are tracking + DVCLive metrics, plots, and parameters independently and want to avoid + duplication). - `cache_images` - If `True`, DVCLive will cache any images logged with `Live.log_image()` as part of `Live.end()`. Defaults to `False`. diff --git a/content/docs/dvclive/live/log_image.md b/content/docs/dvclive/live/log_image.md index 2e95567484..92027c8a62 100644 --- a/content/docs/dvclive/live/log_image.md +++ b/content/docs/dvclive/live/log_image.md @@ -11,7 +11,7 @@ def log_image(name: str, val): ```py from dvclive import Live -with Live(cache_images=True, save_dvc_exp=True) as live: +with Live(cache_images=True) as live: # 1. Log an image from a numpy array: import numpy as np img_numpy = np.ones((500, 500), np.uint8) * 255 @@ -84,7 +84,7 @@ images using the following pattern import numpy as np from dvclive import Live -with Live(save_dvc_exp=True) as live: +with Live() as live: base_img = np.ones((500, 500), np.uint8) for i in range(10): live.log_image( diff --git a/content/docs/dvclive/live/log_plot.md b/content/docs/dvclive/live/log_plot.md index 17d03e2dcd..6d78e48cff 100644 --- a/content/docs/dvclive/live/log_plot.md +++ b/content/docs/dvclive/live/log_plot.md @@ -44,12 +44,11 @@ The method will dump the provided `datapoints` to `{Live.dir}/plots/custom/{name}.json` and store the provided properties to be included in the `plots` section written by `Live.make_dvcyaml()`. -The example snippet would produce the following `dvc.yaml` in -`{Live.dir}/{Live.dvc_file}`: +The example snippet would produce the following `dvc.yaml`: ```yaml plots: - - plots/custom/iris_feature_importance.json: + - dvclive/plots/custom/iris_feature_importance.json: template: bar_horizontal x: importance y: name diff --git a/content/docs/dvclive/live/log_sklearn_plot.md b/content/docs/dvclive/live/log_sklearn_plot.md index 7904e15437..1510f42aa6 100644 --- a/content/docs/dvclive/live/log_sklearn_plot.md +++ b/content/docs/dvclive/live/log_sklearn_plot.md @@ -34,19 +34,19 @@ The method will compute and dump the `kind` plot (see format compatible with `dvc plots`. It will also store the provided properties to be included in the `plots` section -written by `Live.make_dvcyaml()`. The example snippet would produce the -following `dvc.yaml` in `{Live.dir}/{Live.dvc_file}`: +written by `Live.make_dvcyaml()`. The example snippet would add the following to +`dvc.yaml`: ```yaml plots: - - plots/sklearn/roc.json: + - dvclive/plots/sklearn/roc.json: template: simple x: fpr y: tpr title: Receiver operating characteristic (ROC) x_label: False Positive Rate y_label: True Positive Rate - - plots/sklearn/cm.json: + - dvclive/plots/sklearn/cm.json: template: confusion x: actual y: predicted diff --git a/content/docs/dvclive/live/make_dvcyaml.md b/content/docs/dvclive/live/make_dvcyaml.md index 99ff0d39f9..880f2590b2 100644 --- a/content/docs/dvclive/live/make_dvcyaml.md +++ b/content/docs/dvclive/live/make_dvcyaml.md @@ -22,8 +22,8 @@ live.make_dvcyaml() ## Description -Creates `{Live.dir}/dvc.yaml`, which describes and configures metrics, plots, -and parameters. DVC tools use this file to show reports and experiments tables. +Creates `dvc.yaml`, which describes and configures metrics, plots, and +parameters. DVC tools use this file to show reports and experiments tables. @@ -34,12 +34,12 @@ If `Live(dvcyaml=True)`, `Live.next_step()` and `Live.end()` will call ```yaml params: - - params.yaml + - dvclive/params.yaml metrics: - - metrics.json + - dvclive/metrics.json plots: - - plots/metrics - - plots/sklearn/confusion_matrix.json: + - dvclive/plots/metrics + - dvclive/plots/sklearn/confusion_matrix.json: template: confusion x: actual y: predicted diff --git a/content/docs/dvclive/ml-frameworks/catalyst.md b/content/docs/dvclive/ml-frameworks/catalyst.md index a9386d77de..f8e86fc498 100644 --- a/content/docs/dvclive/ml-frameworks/catalyst.md +++ b/content/docs/dvclive/ml-frameworks/catalyst.md @@ -34,9 +34,6 @@ Where: ## Parameters -- `model_file` - (`None` by default) - The name of the file where the model will - be saved at the end of each `step`. - - `live` - (`None` by default) - Optional [`Live`] instance. If `None`, a new instance will be created using `**kwargs`. @@ -51,7 +48,7 @@ Where: from dvclive import Live from dvclive.catalyst import DVCLiveCallback -with Live("custom_dir", save_dvc_exp=True) as live: +with Live("custom_dir") as live: runner.train( model=model, criterion=criterion, @@ -77,7 +74,7 @@ runner.train( loaders=loaders, num_epochs=2, callbacks=[ - DVCLiveCallback(save_dvc_exp=True, dir="custom_dir")]) + DVCLiveCallback(dir="custom_dir")]) ``` [`live`]: /doc/dvclive/live diff --git a/content/docs/dvclive/ml-frameworks/fastai.md b/content/docs/dvclive/ml-frameworks/fastai.md index f670c43b61..54c54e5e5f 100644 --- a/content/docs/dvclive/ml-frameworks/fastai.md +++ b/content/docs/dvclive/ml-frameworks/fastai.md @@ -35,9 +35,6 @@ Where: ## Parameters -- `model_file` - (`None` by default) - The name of the file where the model will - be saved at the end of each `step`. - - `live` - (`None` by default) - Optional [`Live`] instance. If `None`, a new instance will be created using `**kwargs`. @@ -52,7 +49,7 @@ Where: from dvclive import Live from dvclive.fastai import DVCLiveCallback -with Live("custom_dir", save_dvc_exp=True) as live: +with Live("custom_dir") as live: learn = tabular_learner(data_loader, metrics=accuracy) learn.fit_one_cycle( n_epoch=2, @@ -67,7 +64,7 @@ with Live("custom_dir", save_dvc_exp=True) as live: ```python learn.fit_one_cycle( n_epoch=2, - cbs=[DVCLiveCallback(save_dvc_exp=True, dir="custom_dir")]) + cbs=[DVCLiveCallback(dir="custom_dir")]) ``` [`live`]: /doc/dvclive/live diff --git a/content/docs/dvclive/ml-frameworks/huggingface.md b/content/docs/dvclive/ml-frameworks/huggingface.md index d2953e6801..66f689598f 100644 --- a/content/docs/dvclive/ml-frameworks/huggingface.md +++ b/content/docs/dvclive/ml-frameworks/huggingface.md @@ -28,7 +28,7 @@ from dvclive.huggingface import DVCLiveCallback tokenizer=tokenizer, compute_metrics=compute_metrics, ) -trainer.add_callback(DVCLiveCallback(save_dvc_exp=True)) +trainer.add_callback(DVCLiveCallback()) trainer.train() ``` @@ -72,7 +72,7 @@ scenarios. from dvclive.huggingface import DVCLiveCallback trainer.add_callback( - DVCLiveCallback(save_dvc_exp=True, log_model=True)) + DVCLiveCallback(log_model=True)) ``` - Save the `best` checkpoint at the end of training: @@ -82,7 +82,7 @@ from dvclive.huggingface import DVCLiveCallback trainer.args.load_best_model_at_end = True trainer.add_callback( - DVCLiveCallback(save_dvc_exp=True, log_model=True)) + DVCLiveCallback(log_model=True)) ``` - Save updates to the checkpoints directory whenever a new checkpoint is saved: @@ -91,7 +91,7 @@ trainer.add_callback( from dvclive.huggingface import DVCLiveCallback trainer.add_callback( - DVCLiveCallback(save_dvc_exp=True, log_model="all")) + DVCLiveCallback(log_model="all")) ``` ### Passing additional DVCLive arguments @@ -102,7 +102,7 @@ trainer.add_callback( from dvclive import Live from dvclive.huggingface import DVCLiveCallback -with Live("custom_dir", save_dvc_exp=True) as live: +with Live("custom_dir") as live: trainer = Trainer( model, args, train_dataset=train_data, eval_dataset=eval_data, tokenizer=tokenizer) @@ -117,7 +117,7 @@ with Live("custom_dir", save_dvc_exp=True) as live: ```python trainer.add_callback( - DVCLiveCallback(save_dvc_exp=True, dir="custom_dir")) + DVCLiveCallback(dir="custom_dir")) ``` ## Output format diff --git a/content/docs/dvclive/ml-frameworks/keras.md b/content/docs/dvclive/ml-frameworks/keras.md index 8fb32ebc59..42d7fbae5e 100644 --- a/content/docs/dvclive/ml-frameworks/keras.md +++ b/content/docs/dvclive/ml-frameworks/keras.md @@ -17,7 +17,7 @@ from dvclive.keras import DVCLiveCallback model.fit( train_dataset, epochs=num_epochs, validation_data=validation_dataset, - callbacks=[DVCLiveCallback(save_dvc_exp=True)]) + callbacks=[DVCLiveCallback()]) ``` Each metric will be logged to: @@ -34,9 +34,6 @@ Where: ## Parameters -- `model_file` - (`None` by default) - The name of the file where the model will - be saved at the end of each `step`. - - `live` - (`None` by default) - Optional [`Live`] instance. If `None`, a new instance will be created using `**kwargs`. @@ -51,7 +48,7 @@ Where: from dvclive import Live from dvclive.keras import DVCLiveCallback -with Live("custom_dir", save_dvc_exp=True) as live: +with Live("custom_dir") as live: model.fit( train_dataset, epochs=num_epochs, @@ -73,9 +70,7 @@ model.fit( train_dataset, epochs=num_epochs, validation_data=validation_dataset, - callbacks=[DVCLiveCallback( - save_dvc_exp=True, - dir="custom_dir")]) + callbacks=[DVCLiveCallback(dir="custom_dir")]) ``` [`live`]: /doc/dvclive/live diff --git a/content/docs/dvclive/ml-frameworks/lightgbm.md b/content/docs/dvclive/ml-frameworks/lightgbm.md index b6f4917aca..75974211fe 100644 --- a/content/docs/dvclive/ml-frameworks/lightgbm.md +++ b/content/docs/dvclive/ml-frameworks/lightgbm.md @@ -16,14 +16,11 @@ from dvclive.lgbm import DVCLiveCallback lightgbm.train( param, train_data, valid_sets=[validation_data], num_round=5, - callbacks=[DVCLiveCallback(save_dvc_exp=True)]) + callbacks=[DVCLiveCallback()]) ``` ## Parameters -- `model_file` - (`None` by default) - The name of the file where the model will - be saved at the end of each `step`. - - `live` - (`None` by default) - Optional [`Live`] instance. If `None`, a new instance will be created using `**kwargs`. @@ -38,7 +35,7 @@ lightgbm.train( from dvclive import Live from dvclive.lgbm import DVCLiveCallback -with Live("custom_dir", save_dvc_exp=True) as live: +with Live("custom_dir") as live: lightgbm.train( param, train_data, @@ -58,9 +55,7 @@ lightgbm.train( train_data, valid_sets=[validation_data], num_round=5, - callbacks=[DVCLiveCallback( - save_dvc_exp=True, - dir="custom_dir")]) + callbacks=[DVCLiveCallback(dir="custom_dir")]) ``` [`live`]: /doc/dvclive/live diff --git a/content/docs/dvclive/ml-frameworks/mmcv.md b/content/docs/dvclive/ml-frameworks/mmcv.md index b3e55c7b0e..6022171a00 100644 --- a/content/docs/dvclive/ml-frameworks/mmcv.md +++ b/content/docs/dvclive/ml-frameworks/mmcv.md @@ -15,7 +15,7 @@ log_config = dict( interval=100, hooks=[ dict(type='TextLoggerHook'), - dict(type='DvcliveLoggerHook', save_dvc_exp=True) + dict(type='DvcliveLoggerHook') ] ) ``` @@ -39,7 +39,6 @@ log_config = dict( dict(type='TextLoggerHook'), dict( type='DvcliveLoggerHook', - save_dvc_exp=True, dir="custom_dir" ) ] diff --git a/content/docs/dvclive/ml-frameworks/optuna.md b/content/docs/dvclive/ml-frameworks/optuna.md index ee4370334e..768f02527a 100644 --- a/content/docs/dvclive/ml-frameworks/optuna.md +++ b/content/docs/dvclive/ml-frameworks/optuna.md @@ -64,7 +64,7 @@ from dvclive.keras import DVCLiveCallback ... -with Live(save_dvc_exp=True) as live: +with Live() as live: live.log_params(trial.params) model.fit( x_train, diff --git a/content/docs/dvclive/ml-frameworks/pytorch-lightning.md b/content/docs/dvclive/ml-frameworks/pytorch-lightning.md index 3c673bd65a..829dfd7f68 100644 --- a/content/docs/dvclive/ml-frameworks/pytorch-lightning.md +++ b/content/docs/dvclive/ml-frameworks/pytorch-lightning.md @@ -38,7 +38,7 @@ class LitModule(pl.LightningModule): # See Output Format bellow self.log("train_metric", metric, on_step=False, on_epoch=True) -dvclive_logger = DVCLiveLogger(save_dvc_exp=True) +dvclive_logger = DVCLiveLogger() model = LitModule() trainer = pl.Trainer(logger=dvclive_logger) @@ -94,7 +94,7 @@ registry] or automation scenarios). ```python from dvclive.lightning import DVCLiveLogger -logger = DVCLiveLogger(save_dvc_exp=True, log_model=True) +logger = DVCLiveLogger(log_model=True) trainer = Trainer(logger=logger) trainer.fit(model) ``` @@ -104,7 +104,7 @@ trainer.fit(model) ```python from dvclive.lightning import DVCLiveLogger -logger = DVCLiveLogger(save_dvc_exp=True, log_model="all") +logger = DVCLiveLogger(log_model="all") trainer = Trainer(logger=logger) trainer.fit(model) ``` @@ -114,7 +114,7 @@ trainer.fit(model) ```python from dvclive.lightning import DVCLiveLogger -logger = DVCLiveLogger(save_dvc_exp=True, log_model=True), +logger = DVCLiveLogger(log_model=True), checkpoint_callback = ModelCheckpoint( dirpath="model", monitor="val_acc", @@ -132,7 +132,7 @@ trainer.fit(model) from dvclive import Live from dvclive.lightning import DVCLiveLogger -with Live("custom_dir", save_dvc_exp=True) as live: +with Live("custom_dir") as live: trainer = Trainer( logger=DVCLiveLogger(experiment=live)) trainer.fit(model) @@ -146,7 +146,7 @@ with Live("custom_dir", save_dvc_exp=True) as live: from dvclive.lightning import DVCLiveLogger trainer = Trainer( - logger=DVCLiveLogger(save_dvc_exp=True, dir='my_logs_dir')) + logger=DVCLiveLogger(dir='my_logs_dir')) trainer.fit(model) ``` diff --git a/content/docs/dvclive/ml-frameworks/pytorch.md b/content/docs/dvclive/ml-frameworks/pytorch.md index 01e57073f1..871cab9f58 100644 --- a/content/docs/dvclive/ml-frameworks/pytorch.md +++ b/content/docs/dvclive/ml-frameworks/pytorch.md @@ -30,7 +30,7 @@ from DVCLive import Live ... -with Live(save_dvc_exp=True, report="notebook") as live: +with Live(report="notebook") as live: live.log_params(params) diff --git a/content/docs/dvclive/ml-frameworks/scikit-learn.md b/content/docs/dvclive/ml-frameworks/scikit-learn.md index d013df28a5..cff90ecb59 100644 --- a/content/docs/dvclive/ml-frameworks/scikit-learn.md +++ b/content/docs/dvclive/ml-frameworks/scikit-learn.md @@ -29,7 +29,7 @@ from DVCLive import Live ... -with Live(report=None, save_dvc_exp=True) as live: +with Live() as live: live.log_param("n_estimators", n_estimators) diff --git a/content/docs/dvclive/ml-frameworks/tensorflow.md b/content/docs/dvclive/ml-frameworks/tensorflow.md index 7a099ecce0..73f18c607c 100644 --- a/content/docs/dvclive/ml-frameworks/tensorflow.md +++ b/content/docs/dvclive/ml-frameworks/tensorflow.md @@ -22,7 +22,7 @@ let's consider the following example, extracted from the ```python from dvclive import Live -with Live(save_dvc_exp=True) as live: +with Live() as live: for epoch in range(epochs): start_time = time.time() diff --git a/content/docs/dvclive/ml-frameworks/xgboost.md b/content/docs/dvclive/ml-frameworks/xgboost.md index ae1156b4d4..2e725a2e82 100644 --- a/content/docs/dvclive/ml-frameworks/xgboost.md +++ b/content/docs/dvclive/ml-frameworks/xgboost.md @@ -16,15 +16,12 @@ from dvclive.xgb import DVCLiveCallback xgboost.train( param, dtrain, num_round=5, evals=[(dval, "eval_data")] - callbacks=[DVCLiveCallback("eval_data", save_dvc_exp=True)], + callbacks=[DVCLiveCallback("eval_data")], ) ``` ## Parameters -- `model_file` - (`None` by default) - The name of the file where the model will - be saved at the end of each `step`. - - `live` - (`None` by default) - Optional [`Live`] instance. If `None`, a new instance will be created using `**kwargs`. @@ -39,7 +36,7 @@ xgboost.train( from dvclive import Live from dvclive.xgb import DVCLiveCallback -with Live("custom_dir", save_dvc_exp=True) as live: +with Live("custom_dir") as live: xgboost.train( param, dtrain, @@ -61,7 +58,6 @@ xgboost.train( callbacks=[ DVCLiveCallback( "eval_data", - save_dvc_exp=True, dir="custom_dir")], evals=[(dval, "eval_data")]) ``` diff --git a/content/docs/start/experiments/experiment-tracking.md b/content/docs/start/experiments/experiment-tracking.md index d4b7223e01..54c630c3e9 100644 --- a/content/docs/start/experiments/experiment-tracking.md +++ b/content/docs/start/experiments/experiment-tracking.md @@ -25,7 +25,7 @@ $ pip install dvclive ``` In your Python code, you can start versioning your experiments in DVCLive's -`Live` API or framework-specific callbacks with `save_dvc_exp=True`. +`Live` API or framework-specific callbacks. There are some examples below ([other frameworks available](/doc/dvclive/ml-frameworks)): @@ -40,10 +40,7 @@ from dvclive.lightning import DVCLiveLogger ... trainer = Trainer( - logger=DVCLiveLogger( - save_dvc_exp=True, - log_model=True - ) + logger=DVCLiveLogger(log_model=True) ) trainer.fit(model) ``` @@ -57,7 +54,7 @@ from dvclive import Live from dvclive.huggingface import DVCLiveCallback ... -with Live(save_dvc_exp=True) as live: +with Live() as live: trainer.add_callback( DVCLiveCallback(live=live) ) @@ -75,7 +72,7 @@ from dvclive import Live from dvclive.keras import DVCLiveCallback ... -with Live(save_dvc_exp=True) as live: +with Live() as live: model.fit( train_dataset, validation_data=validation_dataset, @@ -94,7 +91,7 @@ with Live(save_dvc_exp=True) as live: ```python from dvclive import Live -with Live(save_dvc_exp=True) as live: +with Live() as live: live.log_param("epochs", NUM_EPOCHS) for epoch in range(NUM_EPOCHS): diff --git a/content/docs/studio/user-guide/experiments/live-metrics-and-plots.md b/content/docs/studio/user-guide/experiments/live-metrics-and-plots.md index a5728c0620..137da86830 100644 --- a/content/docs/studio/user-guide/experiments/live-metrics-and-plots.md +++ b/content/docs/studio/user-guide/experiments/live-metrics-and-plots.md @@ -52,7 +52,7 @@ an example of how you can use [DVCLive] in your training code: ```py from dvclive import Live -with Live(save_dvc_exp=True) as live: +with Live() as live: for i in range(params["epochs"]): ... live.log_metric("accuracy", accuracy) @@ -62,13 +62,6 @@ with Live(save_dvc_exp=True) as live: -Using `save_dvc_exp=True` will ensure that -[the results get saved as a DVC experiment](/doc/dvclive/how-it-works#git-integration). - - - - - DVCLive signals the end of the experiment using `live.end()`. Using `with Live() as live:` or one of the integrations for [ML Frameworks](/doc/dvclive/ml-frameworks) ensures that `live.end()` is diff --git a/content/docs/user-guide/experiment-management/index.md b/content/docs/user-guide/experiment-management/index.md index 782a100c38..657eb4e680 100644 --- a/content/docs/user-guide/experiment-management/index.md +++ b/content/docs/user-guide/experiment-management/index.md @@ -38,7 +38,7 @@ experiments. To save an experiment, you can follow one of these roads: - If you do not have a DVC pipeline, you can log live results from Python code - using [DVCLive] initialized with `save_dvc_exp=True`. + using [DVCLive] initialized. - If you have a DVC [pipeline], use `dvc exp run` to both [run] your code pipeline and save experiment results. `dvc exp run` also enables advanced features like queuing many experiments at once. diff --git a/content/docs/user-guide/experiment-management/visualizing-plots.md b/content/docs/user-guide/experiment-management/visualizing-plots.md index 49012f2b33..8e3c1dcf34 100644 --- a/content/docs/user-guide/experiment-management/visualizing-plots.md +++ b/content/docs/user-guide/experiment-management/visualizing-plots.md @@ -104,13 +104,6 @@ In order to create visualizations, users need to provide the data and file. If you are using [DVCLive](/doc/dvclive/), it will configure plots, but you can also add your own custom plots like this example: - - -Do not customize the `dvclive/dvc.yaml` file generated by DVCLive. DVCLive will -overwrite this file and you will lose your custom configuration. - - - ```yaml plots: # Data series source