File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 11import os
22import os .path as osp
33import sys
4+ import shutil
45import argparse
56
67sys .path .insert (0 , osp .dirname (osp .dirname (osp .abspath (__file__ ))))
@@ -137,6 +138,8 @@ def main():
137138 if "runner_type" not in cfg :
138139 # build the default runner
139140 runner = Runner .from_cfg (cfg )
141+ shutil .rmtree (runner .log_dir , ignore_errors = True )
142+ runner ._log_dir = osp .dirname (args .checkpoint )
140143
141144 # else:
142145 # # build customized runner from the registry
@@ -385,7 +388,8 @@ def representative_dataset():
385388
386389 return tflite_path
387390
388- @lazy_import ('ethos-u-vela' , install_only = True )
391+
392+ @lazy_import ("ethos-u-vela" , install_only = True )
389393def export_vela (tflite_path : str , verify = False ):
390394 # tflite convert to vela.tflite
391395 cmd = f"vela \
Original file line number Diff line number Diff line change 11import argparse
22import os
33import sys
4+ import shutil
45import os .path as osp
56
67sys .path .insert (0 , osp .dirname (osp .dirname (osp .abspath (__file__ ))))
@@ -72,7 +73,7 @@ def parse_args():
7273 return args
7374
7475
75- @lazy_import ("tensorflow" ) # TODO: move it to components
76+ @lazy_import ("tensorflow" ) # TODO: move it to components
7677def main ():
7778 args = parse_args ()
7879
@@ -130,6 +131,9 @@ def main():
130131 model .set_infer (infer_hailo , cfg )
131132
132133 runner = Runner .from_cfg (cfg )
134+ shutil .rmtree (runner .log_dir , ignore_errors = True )
135+ runner ._log_dir = osp .dirname (args .model )
136+
133137 if not (backend [0 ] or backend [1 ]):
134138 runner .load_or_resume = lambda * args : None
135139 runner .model = model
You can’t perform that action at this time.
0 commit comments