Skip to content

Commit

Permalink
Fix yolox detector prediction (#125)
Browse files Browse the repository at this point in the history
* fix export error

Co-authored-by: zxy <zxy@B-X0GHLVDL-0414.local>
  • Loading branch information
2 people authored and Cathy0908 committed Jul 27, 2022
1 parent e3eaa8b commit de84c54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions easycv/predictors/detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,11 @@ def __init__(self,
'meta'], 'meta.config is missing from checkpoint'

config_str = checkpoint['meta']['config']
config_str = config_str[config_str.find('_base_'):]
# get config
basename = os.path.basename(self.model_path)
fname, _ = os.path.splitext(basename)
self.local_config_file = os.path.join(CACHE_DIR,
f'{fname}_config.py')
f'{fname}_config.json')
if not os.path.exists(CACHE_DIR):
os.makedirs(CACHE_DIR)
with open(self.local_config_file, 'w') as ofile:
Expand All @@ -109,6 +108,7 @@ def __init__(self,

# build model
self.model = build_model(self.cfg.model)

self.traceable = getattr(self.model, 'trace_able', False)

self.device = 'cuda' if torch.cuda.is_available() else 'cpu'
Expand Down
2 changes: 1 addition & 1 deletion tests/ut_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
'pretrained_models/faceid')

PRETRAINED_MODEL_YOLOXS_EXPORT = os.path.join(
BASE_LOCAL_PATH, 'pretrained_models/detection/yolox_s/epoch_300.pth')
BASE_LOCAL_PATH, 'pretrained_models/detection/yolox_s/epoch_300_export.pt')
PRETRAINED_MODEL_YOLOXS_END2END_JIT = os.path.join(
BASE_LOCAL_PATH,
'pretrained_models/detection/yolox_s/epoch_300_end2end.jit')
Expand Down

0 comments on commit de84c54

Please sign in to comment.