์ด๋ ๋ชจ๋์ฝ 2019์์์ ๋ฐํ ์๋ฃ ์ ๋๋ค.
์์ ์ฝ๋๋ค์ ๊ธฐ๋ณธ์ ์ผ๋ก google colaboratory๋ก ์์ฑ ํ์๊ธฐ ๋๋ฌธ์ local์์๋ณด๋ค๋ google colab ์ฌ์ฉ์ ๊ถํด๋๋ฆฝ๋๋ค.
google colab์ผ๋ก ๋ฐ๋ก ์คํํ๋ ๋ฐฉ๋ฒ์ ๋ค์ github.com/ ๊น์ง ์ง์ฐ๊ณ ๋์ 'https://colab.research.google.com/github/"๋ฅผ ๋ฃ์ด์ค๋๋ค.
์๋ก ๋ค์ด https://github.com/junhoning/machine_learning_tutorial/blob/master/Visualization %26 TensorBoard/[TensorBoard] Grad-CAM.ipynb ๋
https://colab.research.google.com/github/junhoning/machine_learning_tutorial/blob/master/Visualization %26 TensorBoard/[TensorBoard] Grad-CAM.ipynb ์ด๋ ๊ฒ ๋ฉ๋๋ค.
%%shell
# pip install --upgrade tensorflow-gpu
# pip install --upgrade grpcio
rm -rf ./logs/
file="./logs/"
if [ -d "$file" ]
then
echo "$file found."
else
export fileid=1Tu3AWHzXfT6PUSbNIGfvu86PqI8GEke3
export filename=basic_log.zip
wget --save-cookies cookies.txt 'https://docs.google.com/uc?export=download&id='$fileid -O- \
| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1/p' > confirm.txt
wget --load-cookies cookies.txt -O $filename \
'https://docs.google.com/uc?export=download&id='$fileid'&confirm='$(<confirm.txt)
rm -f confirm.txt cookies.txt
unzip $filename -d ./logs | awk 'BEGIN {ORS=" "} {if(NR%10==0)print "."}'
fi
์์ ์ฝ๋๋ ๊ธฐ๋ณธ์ ์ธ library์ ๋ฐ์ดํฐ๋ค์ ๋ค์ด ๋ฐ๊ธฐ ์ํจ ์ ๋๋ค.
tensorflow๋ ํ์ฌ ๊ธฐ์ค 19.12.07 ์๋ tensorflow 1.15๋ก ์ค์น ๋์ด์๊ธฐ ๋๋ฌธ์ tensorflow 2.0 - gpu๋ก ์ ๊ทธ๋ ์ด๋ ํด์ค๋๋ค.
๊ทธ๋ฆฌ๊ณ tensorboard๊ฐ ๋ฐ๋ก ์๋์ด ์ ๋์ง ์๊ธฐ ๋๋ฌธ์ grpcio๋ฅผ ์ค์น ํด์ค๋๋ค.
์์ ๋ library๊ฐ ์ค์น๊ฐ ๋์์ผ๋ฉด kernel์ restart ํ๊ณ ์ ๋ค์ ์คํ ํด์ค๋๋ค.
์๋์ shell ๋ช ๋ น์ด๋ค์ ํ๋ฒ ๋ค์ด ๋ฐ์์ผ๋ฉด ๋ ์ด์์ ๋ค์ด ๋ฐ์ ํ์๊ฐ ์์ต๋๋ค.
์ฝ๋์ ๋งจ ์๋๋ฅผ ๋ณด๋ฉด ๊ฐ ํ์ผ ๋ณ๋ก logs ๋ผ๋ ํด๋ ์์ log๋ค์ด ์ ์ฅ์ด ๋๋๋ฐ
์ด๋ฅผ ๋ค์ด ๋ฐ์ ์ํ๋ ์์น์ ์์ถ์ ํผ ํ์ ๊ทธ ์์น์์ cmd๋ฅผ ์ด์ด 'tensorboard โlogdir ./'๋ฅผ ์ ๋ ฅํด์ฃผ์๋ฉด ๋ฉ๋๋ค.
Google Colab์์ ์ ์ฅํ ํ์ผ์ ๋ค์ด ๋ฐ๋ ๋ฐฉ๋ฒ์ ์ข์ธก์ ๋ฉ๋ด ์ค file์ ๋๋ฅด์๋ฉด local์์ ๋ค์ด ๋ฐ์ผ์ค ์ ์์ต๋๋ค. ํน์ ๋ณด์ด์ง ์๋ ๊ฒฝ์ฐ ์์ > ๋ชจ์์ผ๋ก "Open the left pane"์ ๋๋ฅด์๋ฉด ๋ฉ๋๋ค.
ํน์๋ ์ดํด๊ฐ ๋์ง ์์ผ์๋ ๋ถ๋ถ์ด ์๋ค๋ฉด [email protected] ์ฐ๋ฝ ์ฃผ์๋ฉด ๋์๋๋ฆฌ๋๋ก ํ๊ฒ ์ต๋๋ค.
๊ฐ์ฌํฉ๋๋ค.