facebookarchive / fb.resnet.torch

Torch implementation of ResNet from http://arxiv.org/abs/1512.03385 and training scripts
Other
2.29k stars 664 forks source link

running time of ResNets #189

Open 1292765944 opened 7 years ago

1292765944 commented 7 years ago

In resnet's paper, it claims that Resnet50/101/152 have lower FLOPS compared to VGG16/19. However, I get much longer forward running time in Resnets than VGG-nets, e.g., Resnet 152 is 4~5 times longer than VGG16). Does anyone encounter similar problem?

aabobakr commented 7 years ago

This is the running time of a forward pass for each of these models on a CPU and a TITAN-X GPU

                               CPU            TITAN-X GPU
        VGG16                648  ms             25 ms   
        ResNet-50            544  ms             18 ms
        ResNet-101           1072 ms             33 ms           
        ResNet-152           1584 ms             43 ms
1292765944 commented 7 years ago

@aabobakr I have similar running time on ResNet-50/101/152. However, I run VGG16 using caffe(with cudnn 5.1, TITAN X GPU maxwell), it only costs me 12ms. By the way, what do you think about the relationship between FLOPS and running time?

Best!

408550969 commented 6 years ago

Hi,does anyone test the speed of resnet-18? Thanks!

aabobakr commented 6 years ago

This is the running time of a forward pass of different models a Core i-7 CPU and a TITAN-X GPU: the time is average over 1000 iterations.

                           Core-i7 CPU         TITAN-X GPU
        VGG11                155  ms             13 ms
        VGG16                280  ms             24 ms   
        ResNet-18            52   ms             4  ms
        ResNet-34            97   ms             8  ms
        ResNet-50            544  ms             18 ms
        ResNet-101           1072 ms             33 ms           
        ResNet-152           1584 ms             43 ms
408550969 commented 6 years ago

Thanks!