Skip to content

Instantly share code, notes, and snippets.

View aviallon's full-sized avatar
😁
Just became a father

Antoine Viallon aviallon

😁
Just became a father
View GitHub Profile
@aviallon
aviallon / keras-minibench.py
Last active November 27, 2020 14:05
Mini benchmark for quickly testing performance on a system
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers as L
from tensorflow.keras import optimizers as O
from time import perf_counter
### BEGIN perf tweaks
physical_devices = tf.config.list_physical_devices('GPU')
print(f"Number of GPUs: {len(physical_devices)}")