Artikel ini untuk CLI Katalog NGC yang menjelaskan cara menggunakan CLI.
Pengantar
CLI Katalog NVIDIA® GPU Cloud (NGC) adalah antarmuka baris perintah untuk mengelola konten dalam NGC Registry. CLI beroperasi di dalam shell dan memungkinkan Anda menggunakan skrip untuk mengotomatisasi perintah. Dengan CLI Katalog NGC, Anda dapat
- Lihat daftar image container Docker yang dipercepat GPU, model deep-learning yang telah dilatih sebelumnya, dan skrip untuk membuat model deep-learning.
- Unduh model dan skrip model.
- Catatan: Saat ini, CLI Katalog NGC tidak menyediakan kemampuan untuk mengunduh gambar penampung. Untuk mendownload image container, gunakan perintah docker pull dari baris perintah Docker.
Dokumen ini memberikan pengantar untuk menggunakan NGC Catalog CLI. Untuk daftar lengkap perintah dan opsi, gunakan -h opsi seperti yang dijelaskan di Menggunakan NGC CLI .
Catatan :Saat ini NGC CLI hanya berfungsi dengan Ubuntu-18 untuk OS lain, silakan lihat Dokumentasi GUI NGC kami:https://www.e2enetworks.com/help/knowledge-base/get-started-with-nvidia-docker-and-ngc-container-registry/#how-to-access -ngc-software-catalog
Untuk Mengunduh Konten Dalam Registri NGC
Konten dalam registri NGC terkunci atau tidak terkunci. Konten yang tidak terkunci tersedia secara bebas untuk diunduh oleh pengguna tamu. Untuk mengunduh konten yang dikunci, Anda harus mendaftar ke akun pengguna komunitas NGC.
Pengguna Tamu
Pengguna tamu dapat mengakses situs web NGC tanpa harus masuk. Dari situs web, pengguna tamu dapat mengunduh CLI Katalog NGC dan mulai menggunakannya untuk melihat konten dan mengunduh konten yang tidak terkunci.
Pengguna Komunitas
Untuk menjadi pengguna komunitas dan mengunduh konten NGC yang terkunci, Anda harus mendaftar ke akun NGC, masuk ke situs web NGC dengan akun Anda, lalu membuat kunci API. Lihat Panduan Memulai NVIDIA GPU Cloud untuk petunjuknya.
Menggunakan CLI Katalog NGC
Untuk menjalankan perintah NGC CLI, masukkan “ngc” diikuti dengan opsi yang sesuai.
Untuk melihat deskripsi opsi yang tersedia dan deskripsi perintah, gunakan opsi -h setelah perintah atau opsi apa pun.
Contoh 1 :Untuk melihat daftar semua opsi yang tersedia untuk ngc, masuk
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 Contoh 2: Untuk melihat deskripsi gambar registri perintah dan opsi, masukkan
root@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 Contoh 3 :Untuk melihat deskripsi info gambar registri perintah dan opsi, masukkan
root@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 Bersiap untuk Mengunduh Konten Terkunci
Jika Anda berencana untuk mengunduh konten yang dikunci, pastikan Anda telah mendaftar untuk akun NGC dan telah membuat kunci API , lalu keluarkan yang berikut ini dan masukkan kunci API Anda saat diminta.
root@localhost:~# ngc config set Enter API key [no-apikey]. Choices: [, 'no-apikey']:<your-api-key>
Mengakses Container Registry
Gambar registri ngc perintah memungkinkan Anda mengakses image container yang dipercepat GPU yang siap digunakan dari registry.
Melihat Informasi Gambar Penampung
Ada beberapa perintah untuk melihat informasi tentang gambar kontainer yang tersedia.
Untuk membuat daftar gambar penampung:
root@localhost:~# ngc registry image list
Contoh keluaran
| 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 | | | | |
Untuk melihat informasi rinci tentang gambar tertentu, tentukan gambar dan tagnya.
Contoh :
root@localhost:~# ngc registry image info nvidia/tensorflow:19.10-py3
Image Information
Name: nvidia/tensorflow:19.10-py3
Architecture: amd64
Schema Version: 1 Mengakses Model Registry
Model registri ngc perintah memungkinkan Anda mengakses model pembelajaran mendalam yang siap digunakan dari registri.
Melihat Informasi Model
Ada beberapa perintah untuk melihat informasi tentang model yang tersedia.
Untuk melihat daftar model yang disediakan oleh NVIDIA:
Contoh keluaran
+-----------------+-----------------+----------------+-----------------+--------------+-----------+---------------+------------+ | 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 | | | | |
Untuk melihat semua versi model, gunakan karakter pengganti *.
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 | |
+---------+----------+---------+------------+-----------+-----------+-----------+--------+--------------+--------------+
Untuk melihat informasi rinci tentang model, Anda dapat menentukan
modelnya
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 atau versi modelnya.
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 Mengunduh Model
Untuk mengunduh model dari registri ke disk lokal Anda, tentukan nama model dan versinya.
root@localhost:~# ngc registry model download-version nvidia/<model-name:version>
Contoh :Mengunduh model ke direktori saat ini.
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
Model diunduh ke folder yang sesuai dengan nama model di direktori saat ini. Anda dapat menentukan jalur lain menggunakan -d . pilihan.
root@localhost:~# ngc registry model download-version nvidia/bert_for_tensorflow:1 -d ./models
Melihat Informasi Model-script
Ada beberapa perintah untuk melihat informasi tentang skrip model yang tersedia.
Untuk melihat daftar skrip model yang disediakan oleh NVIDIA:
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 | | | | |
Untuk melihat informasi mendetail tentang skrip model, Anda dapat menentukan
skrip model
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 atau versi skrip model.
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 Mengunduh Model-script
Untuk mengunduh skrip model dari registri ke disk lokal Anda, tentukan nama dan versi skrip model.
root@localhost:~# ngc registry model-script download-version nvidia/<model-script-name:version>
Contoh :Mengunduh model ke direktori saat ini.
Berikut ini adalah contoh yang menunjukkan output yang mengonfirmasi penyelesaian unduhan:
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
Model diunduh ke folder yang sesuai dengan nama model di direktori saat ini. Anda dapat menentukan jalur lain menggunakan -d . pilihan.
Contoh :Mengunduh skrip mode ke direktori tertentu (/model-scripts).
root@localhost:~# ngc registry model-script download-version nvidia/bert_for_pytorch:1 -d ./model-scripts