SlideShare a Scribd company logo
Debugging with
TensorBoard
이준호
0/42
내 인생 그래프;;;
발표자 소개
이준호
NEUROPHET(뉴로핏)에서 신경망 의료 영상 분석
모두의 연구소의 MoT에서 공부 중
http://www.facebook.com/junhoning
관심있는 것
- Music Generation
- 의료 영상
- 영상 처리
1/42
TensorBoard를 사용하는 이유
학습이나 데이터에 대한 정보 시각화
학습 과정 실시간 확인 가능
기존의 Training과 비교 가능
2/42
TensorBoard 활용
Scalars Images Distributions/Histograms
Debugging with TensorBoard
Introduction Nodes Exploring Graph Tensor Values Run Sessions
Solving NaN problem
3/42
TensorBoard 활용
4/42
TensorBoard를 열면 제일 먼저 볼 수 있는 첫 화면!!
Scalar 값으로 저장한 Cost Curve나 Score 등
다양한 목적으로 사용 가능
5/42
각 Class 별 실시간으로 Score 비교
Inference값의 각 Class 별로 Summary를 저장하면
각 Class 별로 학습이 어떻게 되고 있는지 확인 가능
* Inference : 신경망 결과값
6/42
기존 학습 모델들과 비교
학습하면서도 기존 TensorBoard Event를 함께 열면 동시 비교하면서 진행 과정을 지켜볼 수 있다
실시간 Loss 값만 보면 학습이 되고 있는지 확인이 어려운 진행과정을 그래프로 쉽게 확인 가능
7/42
시간 측정 가능
다양한 그래프 모양 제공
그 외 Scalar 활용 방법
8/42
Segmentation 모델을 돌린다면
실시간으로 Segmentation 결과 확인 가능!!!
9/42
Conv 또는 Filter 등 Layer에서 나온 결과값 실시간 확인
Black Box인 신경망을 조금이라도 더 이해가 가능하다
10/42
Distribution 과 Histogram
11/42
Distribution 과 Histogram
TIP!
12/42
왼쪽의 코드만으로도 모든 Variable 값들을
TensorBoard 기록이 가능하다
Steps
Values
Point Density
Steps – 학습이 진행되면 될 수록 아래로 쌓임
Values & PD – 각 Step의 분포도
왼쪽 그래프를 해석하면
3861 step에서 0.0885 값이
38.5 만큼 가지고 있다.
Histogram을 이해하는 방법
13/42
입력으로 들어간 Image 데이터의 Intensity와 각 Label 별 분포 확인 가능
Histogram 이해하는 방법
14/42
Debugging with TensorBoard
15/42
TensorBoard Debugger
장점
기존 TensorBoard를 열었을 때 보다 매우 간단히 실행 할 수 있다
Step by step로 node들을 실행 할 수 있다
좀 더 깊숙히 더 다양한 방법으로 학습 Model을 들여다 볼 수 있다
단점
실행 속도가 느리다
Alpha 버전이라 오류가 좀 있다
16/42
왼쪽과 같이 기존 TensorBoard를 실행했을 때
--debugger_port 를 추가 해주면 된다!원하는 Debugger Port 입력
(6064든 무엇이든 상관없다)
하위경로에 있는 모든 event 실행
Debugger 실행 방법
17/42
위의 코드들 복사
Session Wrapper로 sess를 씌우면 된다
기존 TensorBoard를 실행했을 때처럼 가 필요 없다
18/42
Debugger를 넣은 후에 다시 script를 실행
학습이 진행되지 않고 Session Wrapper에서 멈추어 있는 것이 확인
Debugging 모드로 대기하고 있는 것이니
TensorBoard에서 계속 진행하면 된다.
19/42
TensorBoard Debugger 흐름 보기
20/42
Selecting Nodes
Explorer Graphs
1. 자세히 보고자 하는 Node들을 선택한다
21/42
Explorer Graphs
2. 각 Node들을 등록하여 sess 실행시 확인 가능하게 한다
1. 자세히 보고자 하는 Node들을 선택한다
22/42
2. 각 Node들을 등록하여 sess 실행시 확인 가능하게 한다
3. Session을 실행한다
Overview Tensor Values
23/42
Iteration을 더 돌려서 확인하고 싶다면
3. Session을 실행한다
Overview Tensor Values
4. Node들의 Value 값들이 변하는 모습들을 관찰한다
24/42
선택한 Node들은 session이 실행되면서
이 때 보여지게 된다
4. Node들의 Value 값들이 변하는 모습들을 관찰한다
5. 각 Node들의 Value 값들 시각화 가능
25/42
Click to view 클릭으로
위의 화면에 Add
보고자 하는 Nodes들을 선택합니다
• 화면의 왼쪽에 Node들 선택 가능
• Node들은 다중선택 가능
• 정규표현식으로도 검색 가능
Selecting Nodes
26/42
왼쪽에 보고 싶은 Node들을 선택하면
우측 화면에 있는 그래프의 노드로 자동 이동
27/42
우측화면에서 GPU 또는 CPU로 실행할 Device도 선택 가능
28/42
역시나 가장 큰 기능은
일반 dbg처럼 Break Point 설정이 가능하다는 것!!!
오른쪽 마우스를 클릭하면 나오는 Continue to는 해당 Node까지 실행 하겠다는 것!
그럼 아래와 같이 아까 학습이 진행되지 않았던 것이 해당 Node까지 갈 때까지 실행 되는 것도 볼 수 있다.
29/42
앞에서 Continue To를 누르면 위와 같이 선택한 Node까지 실행
30/42
해당 노드의 Min 부터
Mean 값까지 확인
31/42
Click to view 클릭으로
위의 화면에 Add
32/42
Slicing 가능
Slice한 데이터가 1D 면 시계열 그래프
2D면 위와 같이 이미지로 표현하게 된다
Time Indices 선택 가능
-1은 가장 최근 결과값을 보여달라는 것
Session을 돌려보자!!
33/42
난 첫번째 Iteration 후의 Value 값들로는 만족 못 한다!!
Continue에서는 얼마나 Session을 돌릴 것인지 선택
34/42
Over Session Runs
-> Session을 얼마나 돌릴 것인지 확인 가능
Till Condition Met by Watched Tensor
-> 원하는 조건이 나올 때까지 돌리기
35/42
NaN 문제 원인을 찾아보자
위의 메시지를 보면 NaN이 뜨는 문제로 학습이 중단된 것이 확인
어디서부터 NaN이 뜨는지 알고 싶다
36/42
Continue를 눌러 다시 NaN이 뜰 때까지 돌려보자
37/42
NaN이 포함되면 멈추게 하는 조건을 준다
38/42
Continue를 누르면 Session이 돌아가고,
NaN이 포함 될 때까지 학습이 멈춘다
39/42
AdamOptimizer 중에
에러가 뜨는 것을 확인
40/42
TensorBoard Debugger는 이러한 도구다
Coding에 대한 Debug 보다는 학습 과정 중 생기는 오류나 문제점들을 해결하기 위한 도구
기존 TF Debugger보다 훨씬 더 편한 도구
어떻게 학습이 되고 있는지 하나씩 뜯어보기 좋은 도구
신경망 Visualization을 강화한 Analystic한 도구
41/42
감사합니다
이준호 (NEUROPHET & MOT)
trackindatalabs@gmail.com
42/42

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Debugging with tensor board