Skip to content

Commit

Permalink
detect.py: support more TF versions for setting seed
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 authored Sep 23, 2023
1 parent cd75981 commit 4290b9c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ def main(data_dir, model, in_weights_path, visualization_path, batch_size,
os.path.join(data_dir, 'label_colors.txt'))

# set TensorFlow seed
tf.random.set_seed(seed)
if seed is not None:
import sys
if int(tf.__version__.split('.')[1]) < 4:
tf.random.set_seed(seed)
else:
tf.keras.utils.set_random_seed(seed)

model = create_model(model, len(id2code), nr_bands, tensor_shape,
backbone=backbone)
Expand Down

1 comment on commit 4290b9c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src
   architectures.py3856184%75, 88, 100, 114, 150, 161, 561, 565, 590–608, 619–626, 718, 728, 798, 855–858, 915–921, 976, 999–1017, 1028–1034, 1073–1080, 1096, 1136, 1209, 1242–1244, 1246, 1281–1286
   cnn_lib.py3099868%48, 117, 128–142, 160, 171, 181–183, 195–201, 225, 270–273, 293–315, 409–420, 451–465, 529–534, 582–592, 651–655, 691–701, 763–777, 842–853, 894–903, 913–917, 938–945, 984–1003, 1014–1019, 1028
   data_preparation.py103991%35, 56, 60, 88, 107, 117, 125, 131, 183
   detect.py71710%3–191
   train.py834447%29, 41, 59, 96, 110, 147–272
   utils.py432151%53–60, 73–80, 94–105
   visualization.py916133%26–40, 75, 100–188
TOTAL109136567% 

Tests Skipped Failures Errors Time
3 0 💤 0 ❌ 0 🔥 170m 19s ⏱️

Please sign in to comment.