리눅스 #우분투

[GPU 서버 설치 #3] Tensorflow 설치 및 BenchMark

hwijin97 2021. 10. 31. 23:18

 

Tensorflow 설치

 

여기서 자신의 CUDA 버전에 맞는 Tensorflow 를 설치한다.

2.5.0 버전을 설치했다.

https://www.tensorflow.org/install/source#tested_build_configurations

 

소스에서 빌드  |  TensorFlow

ML Community Day is November 9! Join us for updates from TensorFlow, JAX, and more Learn more 소스에서 빌드 소스에서 TensorFlow pip 패키지를 빌드하고 Ubuntu Linux 및 macOS에 설치합니다. 명령어는 다른 시스템에도 적용될

www.tensorflow.org

pip install tensorflow==2.5.0

 

tensorflow에서 gpu를 제대로 인식하는지 확인한다.

import tensorflow as tf
from tensorflow.python.client import device_lib

tf.test.is_gpu_available()
device_lib.list_local_devices()

 

BenchMark CNN

 

tensorflow에서 제공하는 cnn 벤치마크를 이용한다.

https://github.com/tensorflow/benchmarks

 

GitHub - tensorflow/benchmarks: A benchmark framework for Tensorflow

A benchmark framework for Tensorflow. Contribute to tensorflow/benchmarks development by creating an account on GitHub.

github.com

 

Git 설치해주고

sudo apt-get install git

원하는 장소에 클론 해주고

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

테스트를 수행해본다.

python scripts/tf_cnn_benchmarks/tf_cnn_benchmarks.py --batch_size=64 --model=resnet50 --variable_update=parameter_server

model 속성에서 alexnet, inception3, resnet152, resnet50, vgg16 등 여러개의 모델을 벤치마크해볼 수 있다.