Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix path normalization on Windows #375

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions allenact/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name."""

import os
import posixpath

if "CUDA_DEVICE_ORDER" not in os.environ:
# Necessary to order GPUs correctly in some cases
Expand Down Expand Up @@ -370,9 +371,7 @@ def load_config(args) -> Tuple[ExperimentConfig, Dict[str, str]]:
), "The path '{}' does not seem to exist (your current working directory is '{}').".format(
args.experiment_base, os.getcwd()
)
rel_base_dir = os.path.relpath( # Normalizing string representation of path
os.path.abspath(args.experiment_base), os.getcwd()
)
rel_base_dir = posixpath.normpath(args.experiment_base)
rel_base_dot_path = rel_base_dir.replace("/", ".")
if rel_base_dot_path == ".":
rel_base_dot_path = ""
Expand Down