speed benchmark for testing tensorflow install

后端 未结 2 639
难免孤独
难免孤独 2021-02-01 19:26

I\'m doubting whether tensorflow is correctly configured on my gpu box, since it\'s about 100x slower per iteration to train a simple linear regression model (batchsize = 32, 15

相关标签:
2条回答
  • 2021-02-01 20:05

    Try tensorflow/tensorflow/models/image/mnist/convolutional.py, that'll print per-step timing.

    On Tesla K40c that should get about 16 ms per step, while about 120 ms for CPU-only on my 3 year old machine


    Edit: This moved to the models repositories: https://github.com/tensorflow/models/blob/master/tutorials/image/mnist/convolutional.py.

    The convolutional.py file is now at models/tutorials/image/mnist/convolutional.py

    0 讨论(0)
  • 2021-02-01 20:05

    Extending Yaroslavs answer: Here is how to do the entire testing process (CUDA and cudNN installed already)

    git clone https://github.com/tensorflow/models.git
    

    Create a Virtual Environment for tensorflow and install tensorflow

    virtualenv --system-site-packages -p python3 tf-venv3
    source tf-venv3/bin/activate
    pip install --upgrade pip
    pip install --upgrade tensorflow-gpu
    

    Run the model within your Virtual Environment

    python models/tutorials/image/mnist/convolutional.py 
    

    My GTX 1070 needs ~5ms per step

    Note: On Geforce 1050 Ti it takes ~10ms per step

    0 讨论(0)
提交回复
热议问题