---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.3
alternate:
  - https://catboost.ai/docs/en/features/snapshots.md
---
> **Documentation Index:** Fetch the complete configuration index at https://catboost.ai/docs/en/llms.txt

# Recovering training after an interruption

During the training, CatBoost makes snapshots — backup copies of intermediate results. If an unexpected interruption occurs (for instance, the computer accidentally turns off), training can be continued from the saved state. In this case, the completed iterations of building trees don't need to be repeated.

Saving snapshots can be enabled when setting training parameters. Refer to the descriptions below for details. If enabled, the default period for making snapshots is 600 seconds. This period can be changed with training parameters described below.

To restore an interrupted training from a previously saved snapshot, launch the training in the same folder with the same parameters. In this case, CatBoost finds the snapshot and resumes the training from the iteration where it has stopped.


{% list tabs %}

- Python package

  **Method**

  - [fit](https://catboost.ai/docs/en/concepts/python-reference_catboost_fit.md) ([CatBoost](https://catboost.ai/docs/en/concepts/python-reference_catboost.md))
  - [fit](https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier_fit.md) ([CatBoostClassifier](https://catboost.ai/docs/en/concepts/python-reference_catboostclassifier.md))
  - [fit](https://catboost.ai/docs/en/concepts/python-reference_catboostregressor_fit.md) ([CatBoostRegressor](https://catboost.ai/docs/en/concepts/python-reference_catboostregressor.md))


  **Parameters**

  {% cut "save_snapshot" %}

    `save_snapshot`

   <!-- source: en/_includes/work_src/reusage/save-snapshot__python-desc__short-desc.md -->
   Enable snapshotting for [restoring the training progress after an interruption](https://catboost.ai/docs/en/features/snapshots.md). If enabled, the default period for making snapshots is 600 seconds. Use the `snapshot_interval` parameter to change this period.
   <!-- endsource: en/_includes/work_src/reusage/save-snapshot__python-desc__short-desc.md -->

   Set this parameter to "True".

  {% endcut %}

  {% cut "snapshot_file" %}

   `snapshot_file`

   The name of the file to save the training progress information in. This file is used for [recovering training after an interruption](https://catboost.ai/docs/en/features/snapshots.md).

   <!-- source: en/_includes/work_src/reusage/snapshot-filename-desc.md -->
   Depending on whether the specified file exists in the file system:
   - Missing — Write information about training progress to the specified file.
   - Exists — Load data from the specified file and continue training from where it left off.
   <!-- endsource: en/_includes/work_src/reusage/snapshot-filename-desc.md -->

   <!-- source: en/_includes/work_src/reusage-common-phrases/snapshot-not-working-for-cv.md -->
   {% note info %}

   This parameter is not supported in the `params` parameter of the [cv](https://catboost.ai/docs/en/concepts/python-reference_cv.md) function.

   {% endnote %}
   <!-- endsource: en/_includes/work_src/reusage-common-phrases/snapshot-not-working-for-cv.md -->

  {% endcut %}

  {% cut "snapshot_interval" %}

   `snapshot_interval`

   <!-- source: en/_includes/work_src/reusage/python__snapshot_interval__desc__div.md -->
   The interval between saving snapshots in seconds.

   The first snapshot is taken after the specified number of seconds since the start of training. Every subsequent snapshot is taken after the specified number of seconds since the previous one. The last snapshot is taken at the end of the training.
   <!-- endsource: en/_includes/work_src/reusage/python__snapshot_interval__desc__div.md -->

  {% endcut %}

- R package

  **Method** [catboost.train](https://catboost.ai/docs/en/concepts/r-reference_catboost-train.md)

  **Parameters**

  {% cut "save_snapshot" %}

     `save_snapshot`

     <!-- source: en/_includes/work_src/reusage/save-snapshot__python-desc__short-desc.md -->
     Enable snapshotting for [restoring the training progress after an interruption](https://catboost.ai/docs/en/features/snapshots.md). If enabled, the default period for making snapshots is 600 seconds. Use the `snapshot_interval` parameter to change this period.
     <!-- endsource: en/_includes/work_src/reusage/save-snapshot__python-desc__short-desc.md -->

     Set this parameter to "True".

  {% endcut %}

  {% cut "snapshot_file" %}

    `snapshot_file`

    The name of the file to save the training progress information in. This file is used for [recovering training after an interruption](https://catboost.ai/docs/en/features/snapshots.md).

    <!-- source: en/_includes/work_src/reusage/snapshot-filename-desc.md -->
    Depending on whether the specified file exists in the file system:
    - Missing — Write information about training progress to the specified file.
    - Exists — Load data from the specified file and continue training from where it left off.
    <!-- endsource: en/_includes/work_src/reusage/snapshot-filename-desc.md -->

     <!-- source: en/_includes/work_src/reusage-common-phrases/snapshot-not-working-for-cv.md -->
     {% note info %}

     This parameter is not supported in the `params` parameter of the [cv](https://catboost.ai/docs/en/concepts/python-reference_cv.md) function.

     {% endnote %}
     <!-- endsource: en/_includes/work_src/reusage-common-phrases/snapshot-not-working-for-cv.md -->

  {% endcut %}

  {% cut "snapshot_interval" %}

   `snapshot_interval`

    <!-- source: en/_includes/work_src/reusage/python__snapshot_interval__desc__div.md -->
    The interval between saving snapshots in seconds.

    The first snapshot is taken after the specified number of seconds since the start of training. Every subsequent snapshot is taken after the specified number of seconds since the previous one. The last snapshot is taken at the end of the training.
    <!-- endsource: en/_includes/work_src/reusage/python__snapshot_interval__desc__div.md -->

  {% endcut %}

- Command-line version

  **Command** [catboost fit](https://catboost.ai/docs/en/references/training-parameters/index.md)

  **Command keys**

   {% cut "--snapshot-file" %}

   `--snapshot-file`

    <!-- source: en/_includes/work_src/reusage/cli__snapshot-file-desc__div.md -->
    Settings for [recovering training after an interruption](https://catboost.ai/docs/en/features/snapshots.md).

    Depending on whether the specified file exists in the file system:
    - Missing — Write information about training progress to the specified file.
    - Exists — Load data from the specified file and continue training from where it left off.
    <!-- endsource: en/_includes/work_src/reusage/cli__snapshot-file-desc__div.md -->

     Use this parameter to enable snapshotting.

    {% endcut %}

   {% cut "--snapshot-interval" %}

    `--snapshot-interval`

    <!-- source: en/_includes/work_src/reusage/python__snapshot_interval__desc__div.md -->
    The interval between saving snapshots in seconds.

    The first snapshot is taken after the specified number of seconds since the start of training. Every subsequent snapshot is taken after the specified number of seconds since the previous one. The last snapshot is taken at the end of the training.
    <!-- endsource: en/_includes/work_src/reusage/python__snapshot_interval__desc__div.md -->

   {% endcut %}

{% endlist %}
