Fix ROOT as relative path (#5129)

* use os.path.relpath instead of relative_to

* use os.path.relpath instead of relative_to

* Remove os.path from val.py

* Remove os.path from train.py

* Update detect.py import to os

* Update export.py import to os

Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Malte LorbachandGlenn Jocher authored and GitHub committed 2021-10-11 09:47:24 -07:00
1 parent 4cf7d487a6
commit 153873e9e4
4 files changed
+6 -4

No files matched your search

+2 -1
View File
@@ -21,6 +21,7 @@ TensorFlow.js:
"""
import argparse
import os
import subprocess
import sys
import time
@@ -34,7 +35,7 @@ FILE = Path(__file__).resolve()
ROOT = FILE.parents[0] # YOLOv5 root directory
if str(ROOT) not in sys.path:
sys.path.append(str(ROOT)) # add ROOT to PATH
ROOT = ROOT.relative_to(Path.cwd()) # relative
ROOT = Path(os.path.relpath(ROOT, Path.cwd())) # relative
from models.common import Conv
from models.experimental import attempt_load