Comments (10)
You should not include the image reading and writing time, because those operations are slow. As a standard convention, none of the models report inference time with image reading and writing operations.
from espnetv2.
No sir I am not including them
ROI of code
start_time = time.time()
# run the mdoel
output1 = model(input)
time_taken = time.time() - start_time
time_list.append(time_taken)
Function used for inference time
def val(args, val_loader, model, criterion):
'''
:param args: general arguments
:param val_loader: loaded for validation dataset
:param model: model
:param criterion: loss function
:return: average epoch loss, overall pixel-wise accuracy, per class accuracy, per class iu, and mIOU
'''
#switch to evaluation mode
model.eval()
iouEvalVal = iouEval(args.classes)
epoch_loss = []
time_list = []
total_batches = len(val_loader)
blist = helpers.get_label_info_new(args.csvfile)
for i, (input, target) in enumerate(val_loader):
if args.onGPU :
print('Non_blocking')
input = input.cuda(non_blocking=True) #torch.autograd.Variable(input, volatile=True)
target = target.cuda(non_blocking=True)#torch.autograd.Variable(target, volatile=True)
else:
print('Blocking')
input = input.cuda() #torch.autograd.Variable(input, volatile=True)
target = target.cuda()#torch.autograd.Variable(target, volatile=True)
start_time = time.time()
# run the mdoel
output1 = model(input)
time_taken = time.time() - start_time
time_list.append(time_taken)
# compute the loss
loss = criterion(output1, target)
epoch_loss.append(loss.item())
# compute the confusion matrix
iouEvalVal.addBatch(output1.max(1)[1].data, target.data)
print('[%d/%d] loss: %.3f time: %.4f' % (i, total_batches, loss.item(), time_taken))
average_epoch_loss_val = sum(epoch_loss) / len(epoch_loss)
overall_acc, per_class_acc, per_class_iu, mIOU = iouEvalVal.getMetric()
print('Average fps ',1/np.mean(np.array(time_list)))
return average_epoch_loss_val, overall_acc, per_class_acc, per_class_iu, mIOU
from espnetv2.
Do not include the first iteration because PyTorch has some initialization time
from espnetv2.
Yes you are right sir. I saw that too. I removed the first 5 samples for profiling and still the average is 53 fps.
from espnetv2.
What version of cudnn and cuda are you using?
from espnetv2.
CUDA
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
CUDNN version 7
libcudnn.so.7
from espnetv2.
Use below code to check cuDNN version. All versions does not have cuDNN optimized depth-wise convolutions.
import torch
print(torch.backends.cudnn.version())
from espnetv2.
import torch
print(torch.backends.cudnn.version())
7402
from espnetv2.
I assume you are using PyTorch 0.4+. COuld you try making following changes to your code and see what happens:
device=torch.device('cuda')
with torch.no_grad():
for i, (input, _) in enumerate(val_loader):
input = input.to(device=device)
start_time = time.time()
# run the mdoel
output1 = model(input)
time_taken = time.time() - start_time
time_list.append(time_taken)
I also noticed that your GPU is different than the one we used. TitanX is considerably faster than GTX 1080, so that explains the difference in speed.
from espnetv2.
I did the changes you mentioned, however the fps is same. I understand that TitanX is faster. I thought some issue in implementation detail is causing this performance issue. But this is too much difference in fps i.e I got almost 3x less speed, I was not expecting this...
Anyhow, thanks for quick response and support. You can close this issue sir.
Really good paper sir.
How can I contact you ? for more information ?
from espnetv2.
Related Issues (20)
- About cyclic learning rate HOT 1
- Downsampling HOT 1
- Training issues (from pretrained weights) HOT 1
- a strange question
- a strange question
- A strange problem encountered during training
- A strange problem encountered during training HOT 15
- About Power consumption HOT 9
- Turning ESPNet into c++ cudastream problem HOT 2
- train.txt create HOT 2
- compared with ShuffleNet V2 HOT 3
- train/eval for another dataset HOT 1
- Question about predict on espnetv2 HOT 3
- Espnet .pth with another scale factor HOT 1
- You have following values as class labels: [ 0 1 2 4 5 6 7 8 10 11 13 255] Some problem with labels. Please check image file: ./city/gtFine/train/cologne/cologne_000000_000019_gtFine_labelTrainIds.png Exiting!! HOT 2
- Network parameters of segmentation model in the paper HOT 5
- Have you used ImageNet pretrained weight to train epsnetv2 for segmentation? HOT 1
- Can anyone upload a pretrained model? HOT 1
- The tool to calculate FLOPs
- Can this model be used for regression tasks?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espnetv2.