question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions about LSTR's performance.

See original GitHub issue

I just tested the performance,and the result seems not that fast,just about 100fps. Is there something wrong with the testing method?Here’s the testing code below.

speed_simple
import torch
import time
import numpy as np
from nnet.py_factory import NetworkFactory
from config import system_configs
import os
import json

cfg_file = os.path.join(system_configs.config_dir, "LSTR.json")
print("cfg_file: {}".format(cfg_file))
with open(cfg_file, "r") as f:
    configs = json.load(f)

configs["system"]["snapshot_name"] = "LSTR"
system_configs.update_config(configs["system"])

torch.cuda.set_device(0)
torch.backends.cudnn.benchmark = True
nnet = NetworkFactory()
nnet.load_params(500000)
nnet.cuda()
nnet.eval_mode()

input_size = [360, 640]
images = torch.zeros((1, 3, input_size[0], input_size[1]), dtype=torch.float32).cuda() + 1
masks = torch.ones((1, 1, input_size[0], input_size[1]), dtype=torch.float32).cuda() + 2

for i in range(10):
    outputs, weights = nnet.test([images, masks])

t_all = []
for i in range(200):
    torch.cuda.synchronize(0)
    t1 = time.time()
    outputs, weights = nnet.test([images, masks])
    torch.cuda.synchronize(0)
    t2 = time.time()
    t_all.append(t2 - t1)

print('average time:', np.mean(t_all) / 1)
print('average fps:', 1 / np.mean(t_all))

print('fastest time:', min(t_all) / 1)
print('fastest fps:', 1 / min(t_all))

print('slowest time:', max(t_all) / 1)
print('slowest fps:', 1 / max(t_all))

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

19reactions
nigyiiicommented, Dec 16, 2020

我佛了

4reactions
liuruijin17commented, Mar 27, 2021

Hi, thanks for you understanding. I will update the arxiv to clarify batch=1’s FPS and batch=16’s FPS on the Table.

Read more comments on GitHub >

github_iconTop Results From Across the Web

25 Performance Review Questions to Start Using Today
With these 25 performance review questions, you can unlock the full potential of your workforce. Start asking these questions today.
Read more >
Top Performance Testing Interview Questions (2022)
In this article, we will be exploring the most commonly asked performance testing interview questions for both freshers and experienced ...
Read more >
Top 9 performance review questions and answers - TechTarget
Having the right employee performance review questions can make a difference in whether the entire process is effective or not. These questions ......
Read more >
Oracle Performance Tuning Interview Questions - MindMajix
Oracle Performance Tuning Interview Questions and Answers · 1. What is Performance Tuning? · 2. What are the different types of Tunings? ·...
Read more >
20 Questions You Should Be Asking in 360-Degree ... - Lattice
20 Questions You Should Be Asking in 360-Degree Performance Reviews · What Makes a Good 360-Degree Review Question? · How to Write 360-Degree ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found