์ฅ์น ๋ฐฐ์น ๋ก๊น
์ด ์ผ์ง ์ํ์์ cifar10_multi_gpu_train.py
์คํฌ๋ฆฝํธ๋ฅผ ์คํ ์ค์ด๋ฉฐ ๋ชจ๋ ์์
์ด CPU์ ๋ฐฐ์น๋๊ณ ์์์ ์ ์ ์์ต๋๋ค. ์คํํ๋ฉด ๋ค์๊ณผ ๊ฐ์ด ์ถ๋ ฅ๋ฉ๋๋ค.
Filling queue with 20000 CIFAR images before starting to train. This will take a few minutes.
I tensorflow/core/common_runtime/local_device.cc:25] Local device intra op parallelism threads: 8
I tensorflow/core/common_runtime/direct_session.cc:45] Direct session inter op parallelism threads: 8
Device mapping: no known devices.
I tensorflow/core/common_runtime/direct_session.cc:111] Device mapping:
softmax_linear/biases/ExponentialMovingAverage: /job:localhost/replica:0/task:0/cpu:0
I tensorflow/core/common_runtime/simple_placer.cc:289] softmax_linear/biases/ExponentialMovingAverage: /job:localhost/replica:0/task:0/cpu:0
.....
.....
Device mapping: no known devices.
ํ์ด ํ์ฌ ์ธ์
๊ณผ ์ฐ๊ฒฐ๋ ์ฅ์น๋ฅผ ๋์ดํด์ผ ํ๋ค๊ณ ์๊ฐํ์ง๋ง ์ฅ์น๊ฐ ์๋ ์ด์ ๋ ๋ฌด์์
๋๊น? ์คํฌ๋ฆฝํธ ํธ์ถ
tf.device('/gpu:0')
.
๋ด GPU๋ Nvidia GeForce GTX 970์ ๋๋ค.
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
์ค์๋ก "--config=cuda" ํ๋๊ทธ ์์ด python ํจํค์ง๋ฅผ ๋น๋ํ์ ๊ฒ์ ๋๋ค. ์ด ํ๋๊ทธ๋ก ๋ค์ ๋น๋ํ ๋ค์ pip๊ฐ tensorflow๋ฅผ ์ ๊ฑฐํ ๋ค์ ์๋ก ๋น๋๋ ํจํค์ง๋ก ๋ค์ ์ค์นํ๋ฉด ์๋ฒฝํ๊ฒ ์๋ํ์ต๋๋ค.
์ฅ์น ๋ฐฐ์น ๋ก๊น ์ด ์ผ์ง ์ํ์์ cifar10_multi_gpu_train.py ์คํฌ๋ฆฝํธ๋ฅผ ์คํํ ๋๋ ๋์ผํ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ต๋๋ค. "--config=cuda" ํ๋๊ทธ ์์ด ์ค์๋ก python ํจํค์ง๋ฅผ ๋น๋ํ์์ ํ๋ฆผ์๋ค"๊ณ ๋งํ ๋ ๋ฌด์จ ๋ป์ธ์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. ์ด๋ค python ํจํค์ง๋ฅผ ๋ค์ ๋น๋ํ๋์ง ์ ์ ์์ต๋๊น?
@GuangmingZhu , TensorFlow ๋ค์ด๋ก๋ ๋ฐ ์ค์ ํ์ด์ง ์์ pip ํจํค์ง๋ฅผ ๋น๋ํ๋ ๋ช ๋ น์ ๋ค์๊ณผ ๊ฐ์์ผ ํฉ๋๋ค.
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
๋ฐฉ๊ธ --config=cuda
์(๋ฅผ) ์์ด๋ฒ๋ ธ์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
์ด ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ์ต๋๋ค.
์ค์๋ก "--config=cuda" ํ๋๊ทธ ์์ด python ํจํค์ง๋ฅผ ๋น๋ํ์ ๊ฒ์ ๋๋ค. ์ด ํ๋๊ทธ๋ก ๋ค์ ๋น๋ํ ๋ค์ pip๊ฐ tensorflow๋ฅผ ์ ๊ฑฐํ ๋ค์ ์๋ก ๋น๋๋ ํจํค์ง๋ก ๋ค์ ์ค์นํ๋ฉด ์๋ฒฝํ๊ฒ ์๋ํ์ต๋๋ค.