Skip to content

Commit

Permalink
Merge pull request zzh8829#85 from friyin/master
Browse files Browse the repository at this point in the history
Fix for Nvidia RTX 2xxx series
  • Loading branch information
zzh8829 authored Nov 14, 2019
2 parents 4f8a3c7 + 05dc413 commit 4cd9a9e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@


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)

if FLAGS.tiny:
yolo = YoloV3Tiny(classes=FLAGS.num_classes)
else:
Expand Down
4 changes: 4 additions & 0 deletions detect_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@


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)

if FLAGS.tiny:
yolo = YoloV3Tiny(classes=FLAGS.num_classes)
else:
Expand Down
4 changes: 4 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@


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)

if FLAGS.tiny:
model = YoloV3Tiny(FLAGS.size, training=True,
classes=FLAGS.num_classes)
Expand Down

0 comments on commit 4cd9a9e

Please sign in to comment.