Skip to content

Commit

Permalink
[Fix] Fix publish_model bug if no parent of out_file. (open-mmlab…
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 authored Sep 26, 2021
1 parent c537485 commit c076a97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/convert_models/publish_model.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) OpenMMLab. All rights reserved.
import argparse
import datetime
import os
import subprocess
from pathlib import Path

import torch
from mmcv import digit_version
Expand Down Expand Up @@ -44,8 +44,8 @@ def process_checkpoint(in_file, out_file):

def main():
args = parse_args()
out_dir = os.path.dirname(args.out_file)
if not os.path.exists(out_dir):
out_dir = Path(args.out_file).parent
if not out_dir.exists():
raise ValueError(f'Directory {out_dir} does not exist, '
'please generate it manually.')
process_checkpoint(args.in_file, args.out_file)
Expand Down

0 comments on commit c076a97

Please sign in to comment.