File tree 2 files changed +10
-2
lines changed 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,11 @@ def main(_argv):
65
65
bbox_tensor = decode (fm , NUM_CLASS , i )
66
66
bbox_tensors .append (bbox_tensor )
67
67
model = tf .keras .Model (input_layer , bbox_tensors )
68
- utils .load_weights (model , FLAGS .weights )
68
+
69
+ if FLAGS .weights .split ("." )[len (FLAGS .weights .split ("." )) - 1 ] == "weights" :
70
+ utils .load_weights (model , FLAGS .weights )
71
+ else :
72
+ model .load_weights (FLAGS .weights ).expect_partial ()
69
73
70
74
model .summary ()
71
75
pred_bbox = model .predict (image_data )
Original file line number Diff line number Diff line change @@ -61,7 +61,11 @@ def main(_argv):
61
61
bbox_tensor = decode (fm , NUM_CLASS , i )
62
62
bbox_tensors .append (bbox_tensor )
63
63
model = tf .keras .Model (input_layer , bbox_tensors )
64
- utils .load_weights (model , FLAGS .weights )
64
+
65
+ if FLAGS .weights .split ("." )[len (FLAGS .weights .split ("." )) - 1 ] == "weights" :
66
+ utils .load_weights (model , FLAGS .weights )
67
+ else :
68
+ model .load_weights (FLAGS .weights ).expect_partial ()
65
69
66
70
model .summary ()
67
71
else :
You can’t perform that action at this time.
0 commit comments