Dieser Artikel für die NGC-Katalog-CLI erklärt die Verwendung der CLI.
Einführung
Die Befehlszeilenschnittstelle des NVIDIA® GPU Cloud (NGC)-Katalogs ist eine Befehlszeilenschnittstelle zum Verwalten von Inhalten innerhalb der NGC-Registrierung. Die CLI arbeitet innerhalb einer Shell und lässt Sie Skripte verwenden, um Befehle zu automatisieren. Mit der NGC Catalog CLI können Sie
- Sehen Sie sich eine Liste mit GPU-beschleunigten Docker-Container-Images, vortrainierten Deep-Learning-Modellen und Skripts zum Erstellen von Deep-Learning-Modellen an.
- Modelle und Modellskripte herunterladen.
- Hinweis: Derzeit bietet die NGC Catalog-CLI keine Möglichkeit, Container-Images herunterzuladen. Um Container-Images herunterzuladen, verwenden Sie den Befehl docker pull in der Docker-Befehlszeile.
Dieses Dokument bietet eine Einführung in die Verwendung der NGC Catalog-CLI. Verwenden Sie für eine vollständige Liste der Befehle und Optionen das -h Option, wie in NGC CLI verwenden erläutert .
Hinweis :Derzeit NGC CLI funktioniert nur mit Ubuntu-18 Informationen zu anderen Betriebssystemen finden Sie in unserer NGC-GUI-Dokumentation:https://www.e2enetworks.com/help/knowledge-base/get-started-with-nvidia-docker-and-ngc-container-registry/#how-to-access -ngc-software-katalog
Herunterladen von Inhalten innerhalb der NGC-Registrierung
Der Inhalt innerhalb der NGC-Registrierung ist entweder gesperrt oder entsperrt. Freigeschaltete Inhalte stehen Gastbenutzern kostenlos zum Download zur Verfügung. Um gesperrte Inhalte herunterzuladen, müssen Sie sich für ein Benutzerkonto der NGC-Community anmelden.
Gastbenutzer
Gastbenutzer können auf die NGC-Website zugreifen, ohne sich anmelden zu müssen. Von der Website können Gastbenutzer die NGC-Katalog-CLI herunterladen und damit beginnen, Inhalte anzuzeigen und freigeschaltete Inhalte herunterzuladen.
Community-Benutzer
Um ein Community-Benutzer zu sein und gesperrte NGC-Inhalte herunterzuladen, müssen Sie sich für ein NGC-Konto registrieren, sich mit Ihrem Konto auf der NGC-Website anmelden und dann einen API-Schlüssel generieren. Anweisungen finden Sie im NVIDIA GPU Cloud-Leitfaden „Erste Schritte“.
NGC-Katalog-CLI verwenden
Um einen NGC-CLI-Befehl auszuführen, geben Sie „ngc“ gefolgt von den entsprechenden Optionen ein.
Um eine Beschreibung der verfügbaren Optionen und Befehlsbeschreibungen anzuzeigen, verwenden Sie die Option -h nach jedem Befehl oder jeder Option.
Beispiel 1 :Um eine Liste aller verfügbaren Optionen für ngc anzuzeigen, geben Sie ein
root@localhost:~# ngc -h
usage: ngc [--debug] [--format_type] [-h] [-v] {config,diag,registry} …
NVIDIA NGC Catalog CLI
optional arguments:
-h, --help show this help message and exit
-v, --version show the CLI version and exit.
--debug Enables debug mode.
--format_type Change output format type. Options: ascii, csv, json.
ngc:
{config,diag,registry}
config Configuration Commands
diag Diagnostic commands
registry Registry Commands Beispiel 2: Um eine Beschreibung des Registrierungsbildes anzuzeigen Befehl und Optionen geben Sie
einroot@localhost:~# ngc registry image -h
usage: ngc registry image [--debug] [--format_type] [-h] {info,list} …
Container Image Registry Commands
optional arguments:
-h, --help show this help message and exit
--debug Enables debug mode.
--format_type Change output format type. Options: ascii, csv, json.
image:
{info,list}
info Display information about an image repository or tagged
image.
list Lists container images accessible by the user Beispiel 3 :Zum Anzeigen einer Beschreibung der Registrierungsbildinformationen Befehl und Optionen geben Sie
einroot@localhost:~# ngc registry image info -h
usage: ngc registry image info [--debug] [--details] [--format_type]
[--history] [--layers] [-h]
[:]
Display information about an image repository or tagged image.
positional arguments:
[:] Name of the image repository or tagged image,
[:]
optional arguments:
-h, --help show this help message and exit
--debug Enables debug mode.
--details Show the details of an image repository
--format_type Change output format type. Options: ascii, csv, json.
--history Show the history of a tagged image
--layers Show the layers of a tagged image Vorbereitung zum Herunterladen gesperrter Inhalte
Wenn Sie gesperrte Inhalte herunterladen möchten, vergewissern Sie sich, dass Sie sich für ein NGC-Konto registriert haben und haben einen API-Schlüssel generiert , geben Sie dann Folgendes ein und geben Sie Ihren API-Schlüssel an der Eingabeaufforderung ein.
root@localhost:~# ngc config set Enter API key [no-apikey]. Choices: [, 'no-apikey']:<your-api-key>
Auf die Container Registry zugreifen
Das ngc-Registrierungs-Image Befehlen können Sie auf einsatzbereite GPU-beschleunigte Container-Images aus der Registrierung zugreifen.
Container-Bildinformationen anzeigen
Es gibt mehrere Befehle zum Anzeigen von Informationen über verfügbare Container-Images.
So listen Sie Container-Images auf:
root@localhost:~# ngc registry image list
Beispielausgabe
| TensorFlow | nvidia/tensorflow | 19.10-py3 | 3.39 GB | Oct 28, 2019 | unlocked | | TensorRT | nvidia/tensorrt | 19.10-py3 | 2.22 GB | Oct 28, 2019 | unlocked | | TensorRT Inference | nvidia/tensorrtserver | 19.10-py3 | 2.76 GB | Oct 28, 2019 | unlocked | | Server | | | | | | | Theano | nvidia/theano | 18.08 | 1.49 GB | Oct 18, 2019 | unlocked | | Transfer Learning | nvidia/tlt- | v1.0_py2 | 3.99 GB | Oct 21, 2019 | unlocked | | Toolkit for Video | streamanalytics | | | | | | Streaming Analytics | | | | | | | Torch | nvidia/torch | 18.08-py2 | 1.24 GB | Oct 18, 2019 | unlocked | | DeepStream - | nvidia/video- | latest | 2.52 GB | Oct 20, 2019 | unlocked | | Intelligent Video | analytics-demo | | | | | | Analytics Demo | | | | | | | Chainer | partners/chainer | 4.0.0b1 | 963.75 MB | Oct 18, 2019 | locked | | Deep Cognition Studio | partners/deep- | cuda9-2.5.1 | 2.05 GB | Oct 18, 2019 | locked | | | learning-studio | | | | | | DeepVision - | partners/deepvision/ad | onpremise-1.0.1 | 240.24 MB | Oct 21, 2019 | locked | | admin.console | min.console | | | | | | DeepVision - | partners/deepvision/ad | onpremise-1.0.1 | 753.95 KB | Oct 21, 2019 | locked | | admin.console.data | min.console.data | | | | | | DeepVision - | partners/deepvision/vf | onpremise-2.0.0 | 3.29 GB | Oct 21, 2019 | locked | | Demographics | .demographics | | | | |
Um detaillierte Informationen zu einem bestimmten Bild anzuzeigen, geben Sie das Bild an und das Tag.
Beispiel :
root@localhost:~# ngc registry image info nvidia/tensorflow:19.10-py3
Image Information
Name: nvidia/tensorflow:19.10-py3
Architecture: amd64
Schema Version: 1 Zugriff auf die Modellregistrierung
Das ngc-Registrierungsmodell Befehlen können Sie auf einsatzbereite Deep-Learning-Modelle aus der Registrierung zugreifen.
Anzeigen von Modellinformationen
Es gibt mehrere Befehle zum Anzeigen von Informationen über verfügbare Modelle.
So zeigen Sie eine Liste der von NVIDIA bereitgestellten Modelle an:
Beispielausgabe
+-----------------+-----------------+----------------+-----------------+--------------+-----------+---------------+------------+ | Name | Repository | Latest Version | Application | Framework | Precision | Last Modified | Permission | +-----------------+-----------------+----------------+-----------------+--------------+-----------+---------------+------------+ | BERT-Large | nvidia/bert_for | 1 | Language | TensorFlow | FP16 | Oct 18, 2019 | unlocked | | (pre-training) | tensorflow | | Modelling | | | | | | for TensorFlow | | | | | | | | | BERT-Large(pre- | nvidia/bert_tf | 1 | Language | Tensorflow | FP16 | Oct 19, 2019 | unlocked | | training using | pretraining_lam | | Modelling | | | | | | LAMB optimizer) | b_16n | | | | | | | | for TensorFlow | | | | | | | | | BERT-Base(fine- | nvidia/bert_tf_ | 2 | Language | Tensorflow | FP16 | Oct 18, 2019 | unlocked | | tuning) - SQuAD | v1_1_base_fp16_ | | Modelling | | | | | | 1.1, seqLen=128 | 128 | | | | | | | | BERT-Base(fine- | nvidia/bert_tf_ | 2 | Language | Tensorflow | FP16 | Oct 18, 2019 | unlocked | | tuning) - SQuAD | v1_1_base_fp16_ | | Modelling | | | | |
Um alle Versionen eines Modells anzuzeigen, verwenden Sie den Platzhalter *.
root@localhost:~# ngc registry model list nvidia/bert_for_tensorflow:*
+---------+----------+---------+------------+-----------+-----------+-----------+--------+--------------+--------------+
| Version | Accuracy | Epochs | Batch Size | GPU Model | Memory | File Size | Owner | Status | Created Date |
| | | | | | Footprint | | | | |
+---------+----------+---------+------------+-----------+-----------+-----------+--------+--------------+--------------+
| 1 | | 1000000 | 256 | V100 | 4011 | 3.77 GB | NVIDIA | UPLOAD_COMPL | Jun 13, 2019 |
| | | | | | | | | ETE | |
+---------+----------+---------+------------+-----------+-----------+-----------+--------+--------------+--------------+
Um detaillierte Informationen zu einem Modell anzuzeigen, können Sie angeben
das Modell
root@localhost:~# ngc registry model info nvidia/bert_for_tensorflow
Model Information
Name: bert_for_tensorflow
Application: Language Modelling
Framework: TensorFlow
Model Format: TF ckpt
Precision: FP16
Description:
# BERT Large(pre-training) for TensorFlow oder die Modellversion.
root@localhost:~# ngc registry model info nvidia/bert_for_tensorflow:1
Model Version Information
Id: 1
Batch Size: 256
Memory Footprint: 4011
Number Of Epochs: 1000000
Accuracy Reached:
GPU Model: V100
Owner Name: NVIDIA
Created Date: 2019-06-13T22:50:06.405Z
Description:
Pretrained weights for the BERT (pre-training) model.
Status: UPLOAD_COMPLETE
Total File Count: 3
Total Size: 3.77 GB Herunterladen eines Modells
Um ein Modell aus der Registrierung auf Ihre lokale Festplatte herunterzuladen, geben Sie den Modellnamen und die Version an.
root@localhost:~# ngc registry model download-version nvidia/<model-name:version>
Beispiel :Laden eines Modells in das aktuelle Verzeichnis.
root@localhost:~# ngc registry model download-version nvidia/bert_for_tensorflow:1 Downloaded 3.46 GB in 6m 22s, Download speed: 9.26 MB/s Transfer id: bert_for_tensorflow_v1 Download status: Completed. Downloaded local path: /root/bert_for_tensorflow_v1 Total files downloaded: 3 Total downloaded size: 3.46 GB Started at: 2019-10-30 18:14:23.667980 Completed at: 2019-10-30 18:20:46.313870 Duration taken: 6m 22s seconds
Das Modell wird in einen Ordner heruntergeladen, der dem Modellnamen im aktuellen Verzeichnis entspricht. Sie können mit -d einen anderen Pfad angeben . Option.
root@localhost:~# ngc registry model download-version nvidia/bert_for_tensorflow:1 -d ./models
Anzeigen von Modellskriptinformationen
Es gibt mehrere Befehle zum Anzeigen von Informationen über verfügbare Modellskripte.
Um eine Liste von Modellskripten anzuzeigen, die von NVIDIA bereitgestellt werden:
root@localhost:~# ngc registry model-script list +-----------------+-----------------+----------------+-----------------+------------+-----------+---------------+------------+ | Name | Registry | Latest Version | Application | Framework | Precision | Last Modified | Permission | +-----------------+-----------------+----------------+-----------------+------------+-----------+---------------+------------+ | BERT for | nvidia/bert_for | 3 | NLP | PyTorch | FPBOTH | Oct 19, 2019 | unlocked | | PyTorch | _pytorch | | | | | | | | BERT for | nvidia/bert_for | 4 | NLP | TensorFlow | FPBOTH | Oct 21, 2019 | unlocked | | TensorFlow | _tensorflow | | | | | | | | Clara Deploy | nvidia/clara_de | 4 | SEGMENTATION | TensorFlow | FPBOTH | Oct 21, 2019 | unlocked | | SDK | ploy_sdk | | | | | | | | Clara AI | nvidia/clara_tr | 1 | KUBEFLOW_PIPELI | TensorFlow | FP32 | Oct 19, 2019 | locked | | Medical Imaging | ain | | NE | | | | |
Um detaillierte Informationen zu einem Modellskript anzuzeigen, können Sie angeben
das Modell-Skript
root@localhost:~# ngc registry model-script info nvidia/bert_for_pytorch
model-script Information
Name: bert_for_pytorch
Application: NLP
Training Framework: PyTorch
Model Format: PyTorch PTH
Precision: FP16, FP32 oder die Modellskriptversion.
root@localhost:~# ngc registry model-script info nvidia/bert_for_pytorch:3
model_script Version Information
Id: 3
Batch Size: 0
Memory Footprint: 0
Number Of Epochs: 0
Accuracy Reached: 0.0
GPU Model: V100 Herunterladen eines Modellskripts
Um ein Modellskript aus der Registrierung auf Ihre lokale Festplatte herunterzuladen, geben Sie den Namen und die Version des Modellskripts an.
root@localhost:~# ngc registry model-script download-version nvidia/<model-script-name:version>
Beispiel :Laden eines Modells in das aktuelle Verzeichnis.
Das folgende Beispiel zeigt die Ausgabe, die den Abschluss des Downloads bestätigt:
root@localhost:~# ngc registry model-script download-version nvidia/bert_for_pytorch:1 Downloaded 275.69 KB in 6s, Download speed: 45.87 KB/s Transfer id: bert_for_pytorch_v1 Download status: Completed. Downloaded local path: /root/bert_for_pytorch_v1 Total files downloaded: 49 Total downloaded size: 275.69 KB Started at: 2019-10-30 18:34:24.956435 Completed at: 2019-10-30 18:34:30.970395 Duration taken: 6s seconds
Das Modell wird in einen Ordner heruntergeladen, der dem Modellnamen im aktuellen Verzeichnis entspricht. Sie können mit -d einen anderen Pfad angeben . Option.
Beispiel :Herunterladen eines Modus-Skripts in ein bestimmtes Verzeichnis (/model-scripts).
root@localhost:~# ngc registry model-script download-version nvidia/bert_for_pytorch:1 -d ./model-scripts