Skip to content

Commit

Permalink
fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoLisin committed Nov 16, 2023
1 parent e9e02f6 commit 0a8db4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions train/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions train/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 0a8db4a

Please sign in to comment.