๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

IT-Engineering135

JupyterLab์—์„œ Tensorboard Extension์„ค์น˜ ๋จผ์ € ์„ค์น˜ํ•ด์•ผ ํ•  ๊ฒƒ JupyterLab Git (version >=2.x) https://gentlesark.tistory.com/29 Anaconda ํ™˜๊ฒฝ์—์„œ Jupyter Notebook ๋ฐ Jupyter Lab ์„ค์น˜ ๋ช…๋ น์–ด ๊ฐ„๋‹จํ•˜๊ฒŒ conda ๋ช…๋ น์–ด์™€ pip ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•œ Jupyter Notebook๊ณผ Jupyter Lab์„ค์น˜๋ฅผ ์•Œ์•„๋ณด์ž. Jupyter Notebook์€ ์ฝ”๋“œ ๋ฐ ๋งˆํฌ๋‹ค์šด(์„ค๋ช… ํ…์ŠคํŠธ)๊ฐ€ ํฌํ•จ๋œ ๋ฌธ์„œ๋ฅผ ์ž‘์„ฑํ•˜๊ณ  ๊ณต์œ  ํ•  ์ˆ˜ ์žˆ๋Š” ์˜คํ”ˆ ์†Œ์Šค ์›น ์‘์šฉ. gentlesark.tistory.com Jupyter Notebook ๋ฐ Jupyter Lab ์„ค์น˜๋Š” ์œ„์˜ ๊ธ€ ์ฐธ์กฐ. ์„ค์น˜๋ฐฉ๋ฒ• pip install --upgrade jupyterlab-git jupyter lab build ์„ค์น˜๋œ.. 2020. 7. 3.
ํšŒ์‚ฌ์—์„œ ์ž๊พธ ๋ฐœ์ƒํ•˜๋Š” SSL ์ธ์ฆ์„œ ๋ฌธ์ œ ํ•ด๊ฒฐํ•˜๊ธฐ A.I. ๊ด€๋ จ ์—…๋ฌด๋ฅผ ํ•˜๋‹ค๋ณด๋ฉด npm์„ ์ด์šฉํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜, pip๋ฅผ ์ด์šฉํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜, conda๋ฅผ ์ด์šฉํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜, yarn์„ ์ด์šฉํ•œ ํŒจํ‚ค์ง€ ์„ค์น˜ ๋“ฑ ๋ญ ์ด๋ ‡๊ฒŒ ๋งŽ๋‚˜ ์‹ถ๊ฒŒ ๋งŽ๋‹ค. https://gentlesark.tistory.com/75 jupyterlab tensorboard extension์„ค์น˜ ๋ฌธ์ œ ํ•ด๊ฒฐ Jupyter Lab์˜ Tensorboard Extension์„ค์น˜ ๋ฐฉ๋ฒ• jupyter labextension install jupyterlab_tensorboard ๋ฌธ์ œ ์ƒํ™ฉ ๋‹ค์Œ์˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. Building jupyterlab assets (build:prod:minimize) An error occur.. gentlesark.tistory.com ์œ„์˜ ๊ธ€๋งŒ ๋ด๋„ yarn์„ค์น˜๋„ .. 2020. 7. 3.
jupyterlab tensorboard extension์„ค์น˜ ๋ฌธ์ œ ํ•ด๊ฒฐ Jupyter Lab์˜ Tensorboard Extension์„ค์น˜ ๋ฐฉ๋ฒ• jupyter labextension install jupyterlab_tensorboard ๋ฌธ์ œ ์ƒํ™ฉ ๋‹ค์Œ์˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. Building jupyterlab assets (build:prod:minimize) An error occured. RuntimeError: npm dependencies failed to install See the log file for details: /tmp/jupyterlab-debug-w9rhfd_1.log ํ•ด๋‹น logํŒŒ์ผ์„ ๋ณด๋‹ˆ ์•„๋ž˜์™€ ๊ฐ™์•˜๋‹ค. Node v12.18.2 Yarn configuration loaded. > /usr/local/lib/nodejs/node-v12.18.2-linu.. 2020. 7. 3.
Linux/Ubuntu์—์„œ Nodejs ์ตœ์‹ ๋ฒ„์ „(LTS) ์„ค์น˜ํ•˜๊ธฐ ์—ฌ๊ธฐ์ €๊ธฐ์„œ Node.js๋ฅผ ์‚ฌ์šฉํ•˜๋‹ค ๋ณด๋ฉด ๋ฒ„์ „์ด ๋งž์ง€ ์•Š์•„ ์ตœ์‹ ๋ฒ„์ „์„ ์„ค์น˜ํ•˜๊ฑฐ๋‚˜ ํŠน์ •๋ฒ„์ „์„ ์„ค์น˜ํ•ด์•ผ ํ•  ๋•Œ๊ฐ€ ์žˆ๋‹ค. ๋ณธ ๊ธ€์€ ์ตœ์‹ ๋ฒ„์ „(LTS)์— ๋งž์ถฐ์ ธ์žˆ์ง€๋งŒ ์ง„์งœ ์ตœ์‹ ์ธ ํ˜„์žฌ๋ฒ„์ „์„ ์„ค์น˜ํ•  ๋•Œ๋„ ๋ฒ„์ „๋ช…๋งŒ ๋ฐ”๊ฟ”์ฃผ๋ฉด ๊ฑฐ์˜ ๋™์ผํ•˜๊ฒŒ ์ ์šฉํ•œ ๋ฐฉ๋ฒ•์ด๋‹ค. ๋ณธ ๋ฐฉ๋ฒ•์€ Linux Binaries๋ฅผ ๋‹ค์šด๋ฐ›์•„ ์ ๋‹นํ•œ ์œ„์น˜์— ์••์ถ•์„ ํ•ด์ œํ•˜๊ณ  ํ™˜๊ฒฝ์„ค์ •์„ ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์ง„ํ–‰๋œ๋‹ค. https://nodejs.org/ko/download/ ์‚ฌ์ดํŠธ์— ์ ‘์† ๋‹ค์šด๋กœ๋“œ | Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org Linux Binaries(x64)๋ฅผ ์„ ํƒํ•ด์„œ ๋‹ค์šด๋กœ๋“œ ์ค€๋น„: ์„ค์น˜๊ฒฝ๋กœ /usr/local/lib/nodej.. 2020. 7. 2.
ํŒŒ์ด์ฌ ํ•จ์ˆ˜๋กœ ํด๋”/๋””๋ ‰ํ† ๋ฆฌ ์ƒ์„ฑํ•˜๊ธฐ(create folder/directory in python) ํŒŒ์ด์ฌ ์ฝ”๋“œ๋กœ ํด๋”๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ์ฝ”๋“œ ์ง„ํ–‰ ์ค‘์— ํŒŒ์ผ ๋ณต์‚ฌ ๋“ฑ์„ ์ˆ˜ํ–‰ํ•  ๋•Œ ํŽธ๋ฆฌํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. https://gentlesark.tistory.com/71 ์œ„ ๊ธ€์—์„œ ํด๋”๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ ํŒŒ์ผ ๋ณต์‚ฌ๊ฐ€ ์ด๋ฃจ์–ด์ง€์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ์—ˆ๋‹ค. ์ด ๊ฒฝ์šฐ python์˜ ๋‚ด์žฅ ๋ชจ๋“ˆ os๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๊ฐ„ํŽธํ•˜๊ฒŒ ํด๋”๋ฅผ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ๋‹ค. ๋งŒ์•ฝ์— ํ˜„์žฌ ํด๋” ํ•˜์œ„ ํด๋”์— text๋ผ๋Š” ์ด๋ฆ„์˜ ํด๋”๋ฅผ ์ƒ์„ฑํ•œ๋‹ค๊ณ  ํ•˜๋ฉด ๋‹ค์Œ ์ฝ”๋“œ๋กœ ์‹คํ–‰ ํ•  ์ˆ˜ ์žˆ๋‹ค. import os os.makedirs('./text') ์œ ์—ฐํ•œ ์˜ˆ์™ธ์ฒ˜๋ฆฌ๋ฅผ ์œ„ํ•ด try/catch๊ตฌ๋ฌธ์œผ๋กœ ํ•ด๋‹น ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•˜๋ ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ํ˜•ํƒœ๋กœ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค. path = './text' try: if not os.path.exists(path): os.makedirs(path) e.. 2020. 6. 29.
ํŒŒ์ด์ฌ ํŒŒ์ผ ๋ณต์‚ฌ(Python file copy with 'shutil') ํŒŒ์ด์ฌ์œผ๋กœ ํŒŒ์ผ ์ž…์ถœ๋ ฅ์€ ํ”ํ•˜๊ฒŒ ๋งŽ์ด ํ•œ๋‹ค. ๋•Œ๋•Œ๋กœ ํŒŒ์ผ ์ž…์ถœ๋ ฅ์ด๋‚˜ ํŒŒ์ผ ์ž‘์—… ์ด์ „์— ํŒŒ์ผ์˜ ๋ณต์‚ฌ๊ฐ€ ํ•„์š”ํ•  ๋•Œ๋„ ์žˆ๋‹ค. ์ด ๋•Œ ํŒŒ์ด์ฌ์—์„œ ํ•ด๋‹น ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์žˆ๋‹ค. ์ด๋ฆ„์€ shutil ์ด๋‹ค. ํŒŒ์ด์ฌ์—์„œ ํŒŒ์ผ ๋ณต์‚ฌํ•˜๊ธฐ ์‚ฌ์šฉ๋ฒ•๋„ ๊ต‰์žฅํžˆ ๋‹จ์ˆœํ•˜๋‹ค. Linux๊ธฐ์ค€ /home/sark/aa.txt๋ฅผ /home/sark/text/aa.txt๋กœ ๋ณต์‚ฌํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด, shutil.copy('/home/sark/aa.txt', '/home/sark/text/aa.txt') ๋งŒ์•ฝ์— ํด๋”๊ฐ€ ์—†๋‹ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๋ฅผ ๋งŒ๋‚  ์ˆ˜๋„ ์žˆ๋‹ค. FileNotFoundError: [Errno 2] No such file or directory: './text/aa.txt' ์ด ๊ฒฝ์šฐ์—๋Š” ํด๋”๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์‚ฌ์šฉํ•˜์ž. ํด๋” .. 2020. 6. 29.
WebP๋ž€ ๋ฌด์—‡์ธ๊ฐ€ - WebP ํ™•์žฅ์ž PNG๋กœ ์ €์žฅํ•˜๊ธฐ(feat. Google Play Store) WebP๋ž€ ๋ฌด์—‡์ธ๊ฐ€? WebP๋Š” Google์ด 2010๋…„์— ๋ฐœํ‘œํ•œ ์ƒˆ๋กœ์šด ์ด๋ฏธ์ง€ ํฌ๋งท์œผ๋กœ ์›น ์ด๋ฏธ์ง€์— ๋Œ€ํ•ด ๋›ฐ์–ด๋‚œ ์†์‹ค/๋ฌด์†์‹ค ์••์ถ•์„ ์ œ๊ณตํ•˜๋Š” ์ตœ์‹  ์ด๋ฏธ์ง€ ํ˜•์‹์ด๋‹ค. WebP ๋ฌด์†์‹ค ์ด๋ฏธ์ง€๋Š” PNG์— ๋น„ํ•ด ํฌ๊ธฐ๊ฐ€ 26% ์ž‘๋‹ค. WebP ์†์‹ค ์ด๋ฏธ์ง€๋Š” ๋™๋“ฑํ•œ SSIM ํ’ˆ์งˆ ์ง€์ˆ˜์—์„œ ๋น„์Šทํ•œ JPEG ์ด๋ฏธ์ง€๋ณด๋‹ค 25-34% ์ž‘๋‹ค. ๋ฌด์†์‹ค WebP๋Š” 22%์˜ ์ถ”๊ฐ€์ ์ธ ๋ฐ”์ดํŠธ๋กœ ํˆฌ๋ช…๋„(์•ŒํŒŒ ์ฑ„๋„)๋ฅผ ์ง€์›ํ•œ๋‹ค. ์†์‹ค RGB ์••์ถ•์ด ํ—ˆ์šฉ๋˜๋Š” ๊ฒฝ์šฐ์—๋„ ์†์‹ค WebP๋Š” ์ผ๋ฐ˜์ ์œผ๋กœ PNG์— ๋น„ํ•ด 3๋ฐฐ ๋” ์ž‘์€ ํŒŒ์ผ ํฌ๊ธฐ๋กœ๋„ ํˆฌ๋ช…๋„๋ฅผ ์ง€์›ํ•œ๋‹ค. Google Play Store .webp ์ด๋ฏธ์ง€ PNG๋กœ ์ €์žฅํ•˜๋Š” ๋ฐฉ๋ฒ• ์˜ˆ์‹œ๋ฅผ ๋“ค์–ด ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•ด๋ณด์ž. ์•„๋ž˜์˜ ์ฃผ์†Œ์— ์ ‘์†ํ•ด๋ณด์ž. https://play.google.com/st.. 2020. 6. 24.
ํŒŒ์ด์ฌ(Python) - ํ˜„์žฌ importํ•œ ๋ชจ๋“ˆ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ํŒŒ์ผ ๊ฒฝ๋กœ ์–ป๊ธฐ(inspect) ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ์—์„œ ์ž‘์—…์„ ํ•˜๋‹ค๋ณด๋ฉด, ํ˜„์žฌ ๋‚ด๊ฐ€ ์–ด๋–ค ํŒŒ์ด์ฌ ๋ฒ„์ „์„ ์“ฐ๊ณ  ์žˆ๋Š”์ง€, ์–ด๋–ค ํ™˜๊ฒฝ์—์„œ ์ž‘์—…ํ•˜๊ณ  ์žˆ๋Š”์ง€๋„ ํ—ท๊ฐˆ๋ฆด ๋•Œ๊ฐ€ ์žˆ๋‹ค. ์•„๋‚˜์ฝ˜๋‹ค๋กœ condaํ™˜๊ฒฝ์„ ์—ฌ๋Ÿฌ๊ฐœ๋กœ ๋‚˜๋ˆ„์–ด ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๋„ ์žˆ๊ฒ ๊ณ , pyenv๊ฐ™์€ ํˆด์„ ํ†ตํ•ด ํŒŒ์ด์ฌ ํ™˜๊ฒฝ์„ ์—ฌ๋Ÿฌ๊ฐœ๋กœ ๋‚˜๋ˆ„์–ด ์ž‘์—…ํ•˜๋Š” ๊ฒฝ์šฐ๋„ ์žˆ์„ ๊ฒƒ์ด๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด ๋‚ด์žฅ ๋ชจ๋“ˆ์ธ os๋ฅผ ๋ถˆ๋Ÿฌ๋“ค์˜€๋Š”๋ฐ os์˜ ์œ„์น˜๊ฐ€ ๊ถ๊ธˆํ•˜๋‹ค๋ฉด ์•„๋ž˜์™€ ๊ฐ™์ด ์ฝ”๋“œ๋ฅผ ์งœ์„œ ์ถœ๋ ฅํ•ด๋ณผ ์ˆ˜ ์žˆ๋‹ค. ์ด ๋•Œ ์‚ฌ์šฉ๋˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์ด๋ฆ„์ด inspect์ด๋‹ค. import os import inspect print(inspect.getfile(os)) ์ถœ๋ ฅ ์˜ˆ์‹œ /home/sark/anaconda3/envs/ai/lib/python3.7/os.py ์ด์ฒ˜๋Ÿผ inspect๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฐ„๋‹จํ•˜๊ฒŒ ํ˜„์žฌ ๋ถˆ๋Ÿฌ๋“ค์ธ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ํŒŒ์ผ .. 2020. 6. 17.
Python ํŒŒ์ผ์ด ํ˜„์žฌ ์‹คํ–‰๋˜๊ณ  ์žˆ๋Š” ๊ฒฝ๋กœ ์–ป์–ด์˜ค๊ธฐ(ํ˜„์žฌํŒŒ์ผ๊ฒฝ๋กœ์–ป๊ธฐ) import os path = os.path.dirname(os.path.abspath(__file__)) print(path) ์œ„์˜ ์ฝ”๋“œ๋ฅผ ํŒŒ์ด์ฌ ์ฝ”๋“œ์— ๊ทธ๋Œ€๋กœ ๋„ฃ๊ณ  ์‹คํ–‰ํ•ด๋ณด๋ฉด ํ˜„์žฌ ์‹คํ–‰์ค‘์ธ ํด๋” ๊ฒฝ๋กœ๊ฐ€ ๋œฐ ๊ฒƒ์ด๋‹ค. os๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ importํ•ด์„œ os.path์˜ ๋ฉ”์†Œ๋“œ์ธ dirname์˜ ์ธ์ž์— os.path์˜ ๋ฉ”์†Œ๋“œ์ธ abspath์˜ argument๋กœ ๋‚ด์žฅ๋ณ€์ˆ˜์ธ __file__์„ ๋„ฃ์–ด์ค€ ๊ฒƒ์œผ๋กœ ์ง€๊ธˆ ํŒŒ์ผ์˜ ์ ˆ๋Œ€๊ฒฝ๋กœ๋ฅผ ๋””๋ ‰ํ† ๋ฆฌ ์ด๋ฆ„์œผ๋กœ ์•Œ๋ ค์ค˜! ๋ผ๊ณ  ํ•œ ๊ฒƒ์ด๋‹ค. 2020. 6. 17.