Fix relative `ROOT` Pytorch Hub custom model bug (#4974)

* Fix relative `ROOT` Pytorch Hub custom model bug

* Update yolo.py
pull/4977/head
Glenn Jocher 2021-09-28 06:36:12 -07:00 committed by GitHub
parent c1bed601e9
commit fb982d6030
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ FILE = Path(__file__).resolve()
ROOT = FILE.parents[1] # 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 = ROOT.relative_to(Path.cwd()) # relative
import numpy as np
import tensorflow as tf

View File

@ -15,7 +15,7 @@ FILE = Path(__file__).resolve()
ROOT = FILE.parents[1] # 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 = ROOT.relative_to(Path.cwd()) # relative
from models.common import *
from models.experimental import *