Fix relative ROOT Pytorch Hub custom model bug (#4974)
* Fix relative `ROOT` Pytorch Hub custom model bug * Update yolo.py
This commit is contained in:
1 parent
c1bed601e9
commit
fb982d6030
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -20,7 +20,7 @@ FILE = Path(__file__).resolve()
|
|||||||
ROOT = FILE.parents[1] # YOLOv5 root directory
|
ROOT = FILE.parents[1] # YOLOv5 root directory
|
||||||
if str(ROOT) not in sys.path:
|
if str(ROOT) not in sys.path:
|
||||||
sys.path.append(str(ROOT)) # add ROOT to 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 numpy as np
|
||||||
import tensorflow as tf
|
import tensorflow as tf
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ FILE = Path(__file__).resolve()
|
|||||||
ROOT = FILE.parents[1] # YOLOv5 root directory
|
ROOT = FILE.parents[1] # YOLOv5 root directory
|
||||||
if str(ROOT) not in sys.path:
|
if str(ROOT) not in sys.path:
|
||||||
sys.path.append(str(ROOT)) # add ROOT to 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.common import *
|
||||||
from models.experimental import *
|
from models.experimental import *
|
||||||
|
|||||||
Reference in new issue
Block a user