diff --git a/train/requirements.txt b/train/requirements.txt index e180ce1..9bb966f 100644 --- a/train/requirements.txt +++ b/train/requirements.txt @@ -1,5 +1,5 @@ -supervisely==6.72.182 -# git+https://github.com/supervisely/supervisely.git@v2-stop +# supervisely==6.72.182 +git+https://github.com/supervisely/supervisely.git@v2-stop-rename ultralytics==8.0.112 --extra-index-url https://download.pytorch.org/whl/cu113 torch==1.10.1+cu113 diff --git a/train/src/main.py b/train/src/main.py index 9721b39..7438aa5 100644 --- a/train/src/main.py +++ b/train/src/main.py @@ -1190,13 +1190,13 @@ def train_batch_watcher_disable(): threading.Thread(target=train_batch_watcher_func, daemon=True).start() def stop_on_batch_end_if_needed(*args, **kwargs): - if app.app_is_stopped(): - raise app.StopApp("This error is expected.") + if app.is_stopped(): + raise app.StopException("This error is expected.") model.add_callback("on_train_batch_end", stop_on_batch_end_if_needed) model.add_callback("on_val_batch_end", stop_on_batch_end_if_needed) - with app.run_with_stop_app_suppression(): + with app.handle_stop(): model.train( data=data_path, epochs=n_epochs_input.get_value(),