Created
May 22, 2019 13:39
-
-
Save mirceast/856c8d77460b099a0a80437e4a33a99e to your computer and use it in GitHub Desktop.
Benchmarking inference performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
fps = np.zeros(200) | |
with torch.no_grad(): # speed it up by not computing gradients since we don't need them for inference | |
for i in range(200): | |
t0 = time.time() | |
out = model(image) | |
fps[i] = 1 / (time.time() - t0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment