diff --git a/references/detection/train_pytorch.py b/references/detection/train_pytorch.py index bc9eda51d..af22fc837 100644 --- a/references/detection/train_pytorch.py +++ b/references/detection/train_pytorch.py @@ -12,6 +12,7 @@ import logging import multiprocessing as mp import time +from pathlib import Path import numpy as np import psutil @@ -29,7 +30,7 @@ from utils import EarlyStopper, plot_recorder, plot_samples SLACK_WEBHOOK_URL = None -SLACK_WEBHOOK_PATH = os.path.join(os.path.expanduser("~"), ".config", "doctr", "slack_webhook_url.txt") +SLACK_WEBHOOK_PATH = Path(os.path.join(os.path.expanduser("~"), ".config", "doctr", "slack_webhook_url.txt")) if SLACK_WEBHOOK_PATH.exists(): with open(SLACK_WEBHOOK_PATH) as f: SLACK_WEBHOOK_URL = f.read().strip()