Skip to content

junhoning/machine_learning_tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

์‹œ์ž‘ํ•˜๊ธฐ

์ด๋Š” ๋ชจ๋‘์ฝ˜ 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 ๋ช…๋ น์–ด๋“ค์€ ํ•œ๋ฒˆ ๋‹ค์šด ๋ฐ›์•˜์œผ๋ฉด ๋” ์ด์ƒ์€ ๋‹ค์šด ๋ฐ›์„ ํ•„์š”๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค.


Offline์œผ๋กœ log ๋ณด๊ธฐ

์ฝ”๋“œ์˜ ๋งจ ์•„๋ž˜๋ฅผ ๋ณด๋ฉด ๊ฐ ํŒŒ์ผ ๋ณ„๋กœ logs ๋ผ๋Š” ํด๋” ์•ˆ์— log๋“ค์ด ์ €์žฅ์ด ๋˜๋Š”๋ฐ

์ด๋ฅผ ๋‹ค์šด ๋ฐ›์•„ ์›ํ•˜๋Š” ์œ„์น˜์— ์••์ถ•์„ ํ‘ผ ํ›„์— ๊ทธ ์œ„์น˜์—์„œ cmd๋ฅผ ์—ด์–ด 'tensorboard โ€”logdir ./'๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.

Google Colab์—์„œ ์ €์žฅํ•œ ํŒŒ์ผ์„ ๋‹ค์šด ๋ฐ›๋Š” ๋ฐฉ๋ฒ•์€ ์ขŒ์ธก์˜ ๋ฉ”๋‰ด ์ค‘ file์„ ๋ˆ„๋ฅด์‹œ๋ฉด local์—์„œ ๋‹ค์šด ๋ฐ›์œผ์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ˜น์‹œ ๋ณด์ด์ง€ ์•Š๋Š” ๊ฒฝ์šฐ ์ž‘์€ > ๋ชจ์–‘์œผ๋กœ "Open the left pane"์„ ๋ˆ„๋ฅด์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.


ํ˜น์‹œ๋‚˜ ์ดํ•ด๊ฐ€ ๋˜์ง€ ์•Š์œผ์‹œ๋Š” ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋ฉด [email protected] ์—ฐ๋ฝ ์ฃผ์‹œ๋ฉด ๋„์™€๋“œ๋ฆฌ๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published