Skip to content

Commit

Permalink
Fix relative ROOT Pytorch Hub custom model bug (ultralytics#4974)
Browse files Browse the repository at this point in the history
* Fix relative `ROOT` Pytorch Hub custom model bug

* Update yolo.py
  • Loading branch information
glenn-jocher authored Sep 28, 2021
1 parent 29c348a commit 0b48222
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion models/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
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
Expand Down
2 changes: 1 addition & 1 deletion models/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
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 *
Expand Down

0 comments on commit 0b48222

Please sign in to comment.