Skip to content

Commit

Permalink
Merge pull request #2 from chhsiao1981/tmp-dir-for-pytorch
Browse files Browse the repository at this point in the history
add os.environ['TEMP'] as outputdir/tmp for pytorch tmp-dir
  • Loading branch information
rudolphpienaar authored May 8, 2024
2 parents f23b842 + 6830b0c commit 7577a42
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spleenseg/spleenseg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# from contextlib import redirect_stderr
# from io import StringIO

# import os
import os
import sys
import re
import pudb
Expand Down Expand Up @@ -98,7 +98,7 @@ def inputFilesSets_trainValidateFind(
"""
trainingSpace: list[dict[str, str]] = trainingData_prep(options)
trainingSet: list[dict[str, str]] = trainingSpace[: -options.validateSize]
validateSet: list[dict[str, str]] = trainingSpace[-options.validateSize :]
validateSet: list[dict[str, str]] = trainingSpace[-options.validateSize:]
return trainingSet, validateSet


Expand Down Expand Up @@ -222,6 +222,9 @@ def main(options: Namespace, inputdir: Path, outputdir: Path):
:param outputdir: directory where to write output files
"""

os.environ['TEMP'] = f'{outputdir}/tmp'
os.makedirs(os.environ['TEMP'], exist_ok=True)

# pudb.set_trace()

envDetail_print(options)
Expand Down

0 comments on commit 7577a42

Please sign in to comment.