From 015132ffa3b7147a91140c642d658a5ea7ead0f6 Mon Sep 17 00:00:00 2001 From: Jerome Simon Date: Sat, 24 Apr 2021 10:42:38 -0400 Subject: [PATCH] Dynamically find `logs` directory (#8) Logs used to be fetched within the current execution directory. Fetch them in the module directory instead. --- acrosome_counter/build_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/acrosome_counter/build_model.py b/acrosome_counter/build_model.py index 73dfcb2..0a569ae 100644 --- a/acrosome_counter/build_model.py +++ b/acrosome_counter/build_model.py @@ -1,14 +1,14 @@ # -*- coding: utf-8 -*- """Build the network.""" -from os.path import join +from os.path import join, dirname, pardir from detectron2 import model_zoo from detectron2.config import get_cfg from .load_dataset import QTY_CLASSES -LOG_DIR = join(".", "logs") +LOG_DIR = join(dirname(__file__), pardir, "logs") PRETRAINED_CHECKPOINT = model_zoo.get_checkpoint_url( "COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml" )