Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# load in weights and classes
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
tf.config.set_visible_devices(physical_devices[0:1], 'GPU')

if tiny:
yolo = YoloV3Tiny(classes=num_classes)
Expand Down
2 changes: 1 addition & 1 deletion detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
def main(_argv):
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
tf.config.set_visible_devices(physical_devices[0:1], 'GPU')

if FLAGS.tiny:
yolo = YoloV3Tiny(classes=FLAGS.num_classes)
Expand Down
2 changes: 1 addition & 1 deletion detect_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
def main(_argv):
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
tf.config.set_visible_devices(physical_devices[0:1], 'GPU')

if FLAGS.tiny:
yolo = YoloV3Tiny(classes=FLAGS.num_classes)
Expand Down
4 changes: 2 additions & 2 deletions yolov3_tf2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def YoloV3(size=None, channels=3, anchors=yolo_anchors,
masks=yolo_anchor_masks, classes=80, training=False):
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
tf.config.set_visible_devices(physical_devices[0:1], 'GPU')
x = inputs = Input([size, size, channels], name='input')

x_36, x_61, x = Darknet(name='yolo_darknet')(x)
Expand Down Expand Up @@ -242,7 +242,7 @@ def YoloV3Tiny(size=None, channels=3, anchors=yolo_tiny_anchors,
masks=yolo_tiny_anchor_masks, classes=80, training=False):
physical_devices = tf.config.experimental.list_physical_devices('GPU')
if len(physical_devices) > 0:
tf.config.experimental.set_memory_growth(physical_devices[0], True)
tf.config.set_visible_devices(physical_devices[0:1], 'GPU')
x = inputs = Input([size, size, channels], name='input')

x_8, x = DarknetTiny(name='yolo_darknet')(x)
Expand Down