@@ -397,9 +397,21 @@ def main(args):
397
397
if args .graph_net_samples_path is None
398
398
else args .graph_net_samples_path
399
399
)
400
+
401
+ previous_failed_model_pathes = []
402
+ if args .previous_collect_result_path is not None :
403
+ with open (args .previous_collect_result_path , "r" ) as f :
404
+ for line in f .readlines ():
405
+ if "[ModelStats]" in line :
406
+ fields = line .strip ().split ()
407
+ model_path = fields [2 ].split (":" )[- 1 ]
408
+ is_complete = fields [- 1 ].split (":" )[- 1 ]
409
+ if is_complete == "False" :
410
+ previous_failed_model_pathes .append (model_path )
411
+
400
412
i = 0
401
413
for root , dirs , files in os .walk (graph_net_samples_path ):
402
- if is_single_model_dir (root ):
414
+ if is_single_model_dir (root ) and root in previous_failed_model_pathes :
403
415
print (f"[{ i } ] Collect information for { root } " )
404
416
cmd = [
405
417
"python" ,
@@ -447,6 +459,13 @@ def main(args):
447
459
default = None ,
448
460
help = "GraphNet samples directory. e.g '../../samples'" ,
449
461
)
462
+ parser .add_argument (
463
+ "--previous-collect-result-path" ,
464
+ type = str ,
465
+ required = False ,
466
+ default = None ,
467
+ help = "Previous collect result path, use to recollect the failed cases" ,
468
+ )
450
469
parser .add_argument (
451
470
"--log-prompt" ,
452
471
type = str ,
@@ -455,4 +474,5 @@ def main(args):
455
474
help = "Log prompt for stats log filtering." ,
456
475
)
457
476
args = parser .parse_args ()
477
+ print (f"[CollectStats Arguments] { args } " )
458
478
main (args = args )
0 commit comments