Today, data scientists who are training deep learning models need to identify and remediate model training issues to meet accuracy targets for production deployment, and require a way to utilize standard tools for debugging model training. Among the data scientist community, TensorBoard is a popular toolkit that allows data scientists to visualize and analyze various aspects of their machine learning (ML) models and training processes. It provides a suite of tools for visualizing training metrics, examining model architectures, exploring embeddings, and more. TensorFlow and PyTorch projects both endorse and use TensorBoard in their official documentation and examples.
Amazon SageMaker with TensorBoard is a capability that brings the visualization tools of TensorBoard to SageMaker. Integrated with SageMaker training jobs and domains, it provides SageMaker domain users access to the TensorBoard data and helps domain users perform model debugging tasks using the SageMaker TensorBoard visualization plugins. When they create a SageMaker training job, domain users can use TensorBoard using the SageMaker Python SDK or Boto3 API. SageMaker with TensorBoard is supported by the SageMaker Data Manager plugin, with which domain users can access many training jobs in one place within the TensorBoard application.
In this post, we demonstrate how to set up a training job with TensorBoard in SageMaker using the SageMaker Python SDK, access SageMaker TensorBoard, explore training output data visualized in TensorBoard, and delete unused TensorBoard applications.
Megoldás áttekintése
A typical training job for deep learning in SageMaker consists of two main steps: preparing a training script and configuring a SageMaker training job launcher. In this post, we walk you through the required changes to collect TensorBoard-compatible data from SageMaker training.
Előfeltételek
To start using SageMaker with TensorBoard, you need to set up a SageMaker domain with an Amazon VPC under an AWS account. Domain user profiles for each individual user are required to access the TensorBoard on SageMaker, and the AWS Identity and Access Management (IAM) execution role needs a minimum set of permissions, including the following:
sagemaker:CreateApp
sagemaker:DeleteApp
sagemaker:DescribeTrainingJob
sagemaker:Search
s3:GetObject
s3:ListBucket
For more information on how to set up SageMaker Domain and user profiles, see Bekapcsolva az Amazon SageMaker tartományba a gyors beállítás segítségével és a Add and Remove User Profiles.
Könyvtárstruktúra
Használat során Amazon SageMaker Studio, the directory structure can be organized as follows:
Itt, script/train.py
is your training script, and simple_tensorboard.ipynb
launches the SageMaker training job.
Modify your training script
You can use any of the following tools to collect tensors and scalars: TensorBoardX, TensorFlow Summary Writer, PyTorch Summary Writer, or Amazon SageMaker Debugger, and specify the data output path as the log directory in the training container (log_dir
). In this sample code, we use TensorFlow to train a simple, fully connected neural network for a classification task. For other options, refer to Prepare a training job with a TensorBoard output data configuration. Az train()
függvényt használjuk tensorflow.keras.callbacks
.TensorBoard tool to collect tensors and scalars, specify /opt/ml/output/tensorboard
as the log directory in the training container, and pass it to model training callbacks argument. See the following code:
Construct a SageMaker training launcher with a TensorBoard data configuration
Use sagemaker.debugger.TensorBoardOutputConfig while configuring a SageMaker framework estimator, which maps the Amazon egyszerű tárolási szolgáltatás (Amazon S3) bucket you specify for saving TensorBoard data with the local path in the training container (for example, /opt/ml/output/tensorboard
). You can use a different container local output path. However, it must be consistent with the value of the LOG_DIR
variable, as specified in the previous step, to have SageMaker successfully search the local path in the training container and save the TensorBoard data to the S3 output bucket.
Next, pass the object of the module to the tensorboard_output_config
parameter of the estimator class. The following code snippet shows an example of preparing a TensorFlow estimator with the TensorBoard output configuration parameter.
The following is the boilerplate code:
The following code is for the training container:
The following code is the TensorBoard configuration:
Launch the training job with the following code:
Access TensorBoard on SageMaker
You can access TensorBoard with two methods: programmatically using the sagemaker.interactive_apps.tensorboard
module that generates the URL or using the TensorBoard landing page on the SageMaker console. After you open TensorBoard, SageMaker runs the TensorBoard plugin and automatically finds and loads all training job output data in a TensorBoard-compatible file format from S3 buckets paired with training jobs during or after training.
The following code autogenerates the URL to the TensorBoard console landing page:
This returns the following message with a URL that opens the TensorBoard landing page.
For opening TensorBoard from the SageMaker console, please refer to How to access TensorBoard on SageMaker.
When you open the TensorBoard application, TensorBoard opens with the SageMaker Data Manager tab. The following screenshot shows the full view of the SageMaker Data Manager tab in the TensorBoard application.
A SageMaker Data Manager tab, you can select any training job and load TensorBoard-compatible training output data from Amazon S3.
- A Add Training Job section, use the check boxes to choose training jobs from which you want to pull data and visualize for debugging.
- A pop-art design, négy időzóna kijelzése egyszerre és méretének arányai azok az érvek, amelyek a NeXtime Time Zones-t kiváló választássá teszik. Válassza a Add Selected Jobs.
The selected jobs should appear in the Tracked Training Jobs szakasz.
Refresh the viewer by choosing the refresh icon in the upper-right corner, and the visualization tabs should appear after the job data is successfully loaded.
Explore training output data visualized in TensorBoard
A Idősorok tab and other graphics-based tabs, you can see the list of Tracked Training Jobs in the left pane. You can also use the check boxes of the training jobs to show or hide visualizations. The TensorBoard dynamic plugins are activated dynamically depending on how you have set your training script to include summary writers and pass callbacks for tensor and scalar collection, and the graphics tabs also appear dynamically. The following screenshots show example views of each tab with visualizations of the collected metrics of two training jobs. The metrices include time series, scalar, graph, distribution, and histogram plugins.
The following screenshot is the Idősorok tab view.
The following screenshot is the Scalars tab view.
The following screenshot is the grafikonok tab view.
The following screenshot is the disztribúciók tab view.
The following screenshot is the Histograms tab view.
Tisztítsuk meg
After you are done with monitoring and experimenting with jobs in TensorBoard, shut the TensorBoard application down:
- A SageMaker konzolon válassza a lehetőséget Domains a navigációs ablaktáblában.
- Válassza ki a domainjét.
- Choose your user profile.
- Alatt Apps, választ Az alkalmazás törlése for the TensorBoard row.
- A pop-art design, négy időzóna kijelzése egyszerre és méretének arányai azok az érvek, amelyek a NeXtime Time Zones-t kiváló választássá teszik. Válassza a Yes, delete app.
- Enter delete in the text box, then choose töröl.
A message should appear at the top of the page: “Default is being deleted”.
Következtetés
TensorBoard is a powerful tool for visualizing, analyzing, and debugging deep learning models. In this post, we provide a guide to using SageMaker with TensorBoard, including how to set up TensorBoard in a SageMaker training job using the SageMaker Python SDK, access SageMaker TensorBoard, explore training output data visualized in TensorBoard, and delete unused TensorBoard applications. By following these steps, you can start using TensorBoard in SageMaker for your work.
We encourage you to experiment with different features and techniques.
A szerzőkről
Dr. Baichuan Sun az AWS AI/ML vezető adattudósa. Szenvedélyesen törekszik a stratégiai üzleti problémák megoldására az ügyfelekkel, adatvezérelt módszertant használva a felhőben, és projekteket vezetett olyan kihívásokkal teli területeken, mint a robotika számítógépes látásmódja, idősoros előrejelzés, ároptimalizálás, prediktív karbantartás, gyógyszerfejlesztés, termékajánló rendszer, stb. Szabadidejében szívesen utazik és a családjával lóg.
Manoj Ravi az Amazon SageMaker vezető termékmenedzsere. Szenvedélye a következő generációs mesterséges intelligencia termékek készítése, és olyan szoftvereken és eszközökön dolgozik, amelyek megkönnyítik a nagyszabású gépi tanulást az ügyfelek számára. A Haas School of Business MBA fokozatát, a Carnegie Mellon Egyetemen pedig információs rendszermenedzsmentből szerzett mesterfokozatot. Szabadidejében Manoj szívesen teniszez és tájfotózással foglalkozik.
- SEO által támogatott tartalom és PR terjesztés. Erősödjön még ma.
- PlatoAiStream. Web3 adatintelligencia. Felerősített tudás. Hozzáférés itt.
- A jövő pénzverése – Adryenn Ashley. Hozzáférés itt.
- Részvények vásárlása és eladása PRE-IPO társaságokban a PREIPO® segítségével. Hozzáférés itt.
- Forrás: https://aws.amazon.com/blogs/machine-learning/amazon-sagemaker-with-tensorboard-overview-of-a-hosted-tensorboard-experience/
- :van
- :is
- $ UP
- 1
- 10
- 100
- 11
- 15%
- 26%
- 28
- 7
- 8
- 9
- a
- Rólunk
- hozzáférés
- Fiók
- pontosság
- Ádám
- Után
- AI
- AI / ML
- Minden termék
- lehetővé teszi, hogy
- Is
- amazon
- Amazon SageMaker
- között
- an
- elemez
- elemzése
- és a
- bármilyen
- api
- app
- megjelenik
- Alkalmazás
- alkalmazások
- VANNAK
- területek
- érv
- AS
- szempontok
- At
- automatikusan
- AWS
- BE
- óta
- hogy
- mindkét
- Doboz
- dobozok
- Bring
- Épület
- üzleti
- by
- TUD
- Carnegie Mellon
- kihívást
- Változások
- ellenőrizze
- A pop-art design, négy időzóna kijelzése egyszerre és méretének arányai azok az érvek, amelyek a NeXtime Time Zones-t kiváló választássá teszik. Válassza a
- választja
- osztály
- felhő
- kód
- gyűjt
- gyűjtemény
- közösség
- számítógép
- Számítógépes látás
- Configuration
- összefüggő
- következetes
- Konzol
- Konténer
- Sarok
- teremt
- Ügyfelek
- dátum
- adattudós
- adatalapú
- adatkészletek
- dátum idő
- mély
- mély tanulás
- bizonyítani
- attól
- bevetés
- Fejlesztés
- terjesztés
- dokumentáció
- domain
- domainek
- csinált
- le-
- alatt
- dinamikus
- dinamikusan
- minden
- könnyebb
- más
- ösztönzése
- jóváhagyott
- korszakok
- stb.
- értékelték
- vizsgálva
- példa
- példák
- végrehajtás
- tapasztalat
- kísérlet
- feltárása
- Feltárása
- család
- Jellemzők
- megfelelő
- következő
- következik
- A
- formátum
- Keretrendszer
- ból ből
- Tele
- teljesen
- funkció
- generál
- grafikon
- grafika
- útmutató
- Legyen
- he
- segít
- elrejt
- övé
- tart
- házigazdája
- Hogyan
- How To
- azonban
- HTML
- http
- HTTPS
- ICON
- azonosítani
- Identitás
- if
- importál
- in
- tartalmaz
- Beleértve
- egyéni
- információ
- Információs Rendszerek
- integrált
- bele
- kérdések
- IT
- Munka
- Állások
- jpg
- json
- keras
- leszállási
- táj
- nagyarányú
- elindítja
- tojók
- vezető
- tanulás
- balra
- Lista
- kiszámításának
- terhelések
- helyi
- log
- le
- gép
- gépi tanulás
- Fő
- karbantartás
- csinál
- vezetés
- menedzser
- sok
- Térképek
- Találkozik
- Mellon
- üzenet
- Módszertan
- mód
- Metrics
- minimum
- ML
- modell
- modellek
- Modulok
- ellenőrzés
- több
- kell
- Keresse
- Navigáció
- Szükség
- igények
- hálózat
- neurális hálózat
- szám
- tárgy
- of
- on
- ONE
- nyitva
- nyitás
- nyit
- optimalizálás
- Opciók
- or
- Szervezett
- OS
- Más
- ki
- teljesítmény
- áttekintés
- oldal
- párosított
- üvegtábla
- paraméter
- elhalad
- szenvedélyes
- ösvény
- Teljesít
- engedélyek
- Gyógyszeripari
- fényképezés
- Hely
- Plató
- Platón adatintelligencia
- PlatoData
- játék
- kérem
- csatlakoztat
- Plugins
- Népszerű
- állás
- erős
- előkészítése
- előző
- ár
- problémák
- Folyamatok
- Termékek
- termék menedzser
- Termelés
- Termékek
- projektek
- ad
- biztosít
- Piton
- pytorch
- Quick
- Ajánlást
- vidék
- eltávolítása
- szükség
- kötelező
- visszatérés
- Visszatér
- robotika
- Szerep
- SOR
- sagemaker
- Megtakarítás
- megtakarítás
- Iskola
- Tudós
- tudósok
- screenshotok
- sdk
- Keresés
- lát
- kiválasztott
- idősebb
- Series of
- ülés
- készlet
- felépítés
- kellene
- előadás
- Műsorok
- Egyszerű
- szoftver
- Megoldása
- standard
- kezdet
- Lépés
- Lépései
- tárolás
- tárolni
- Stratégiai
- stratégiai üzlet
- struktúra
- stúdió
- sikeresen
- kíséret
- ÖSSZEFOGLALÓ
- Támogatott
- rendszer
- Systems
- célok
- Feladat
- feladatok
- technikák
- tensorflow
- Tesztelés
- hogy
- A
- azok
- akkor
- Ezek
- ők
- ezt
- Keresztül
- idő
- Idősorok
- nak nek
- szerszám
- eszköztár
- szerszámok
- felső
- Vonat
- Képzések
- Utazó
- kettő
- típus
- tipikus
- alatt
- egyetemi
- felhasználatlan
- URL
- használ
- használó
- Felhasználók
- segítségével
- hasznosít
- érték
- különféle
- Megnézem
- nézetek
- látomás
- megjelenítés
- akar
- Út..
- we
- amikor
- ami
- míg
- WHO
- val vel
- belül
- Munka
- művek
- író
- te
- A te
- zephyrnet