NVIDIA之AI Course:Getting Started with AI on Jetson Nano—Class notes(二)
Notice
The original text comes from NVIDIA-AI Course. This article only provides Chinese translation.
正在更新……
The NVIDIA® Jetson Nano™ Developer Kit is a small AI computer for makers, learners, and developers. After following along with this brief guide, you’ll be ready to start building practical AI applications, cool AI robots, and more.
NVIDIA®Jetson Nano™Developer Kit是一款面向制造商、学习者和开发人员的小型人工智能计算机。在遵循了这个简短的指南之后,您将准备好开始构建实际的AI应用程序、酷的AI机器人等等。
Initially, a computer with Internet connection and the ability to flash your microSD card is also required. Downloading the image may take a considerable amount of time, depending on your internet speed. You may wish to begin downloading the NVIDIA DLI Jetson Nano SD Card Image immediately so that it can work in the background while you review the rest of the setup information.
才开始,还需要一台具有能够联网和带有闪存microSD卡功能的计算机。下载图像可能需要相当长的时间,这取决于您的互联网速度。您可能希望立即开始下载NVIDIA DLI Jetson nano SD卡图像,以便在您查看其余设置信息时在后台工作。
Your Jetson Nano Developer Kit box includes: 您的Jetson Nano开发工具包包括
MicroSD Card
The Jetson Nano Developer Kit uses a microSD card as a boot device and for main storage. It’s important to have a card that’s fast and large enough for your projects; the minimum recommended for this course is a 32GB UHS-I card.
Jetson Nano开发工具包使用microSD卡作为引导设备和主存储。对于你的项目来说,拥有一张足够快和足够大的卡片是很重要的;本课程推荐的最小容量是32GB的UHS-I卡。
See the instructions in the "Write Image to the microSD Card" lesson that follows to flash your microSD card according to the type of computer you are using: Windows, Mac, or Linux.
请参阅“将图像写入microSD卡”教程中的说明,该教程将根据您使用的计算机类型(Windows、Mac或Linux)来刷新microSD卡。
5V 4A Power Supply With 2.1mm DC Barrel Connector 5V 4A电源,2.1mm直流电筒连接器
For this course, the 5V 4A DC barrel jack power supply is required. Although it is possible to power the Jetson Nano with a smaller microUSB supply, this is not robust enough for the high GPU compute load we require for our projects. In addition, you will need the microUSB port available as a direct connection to your computer for this course.
本课程需要5V 4A直流电筒千斤顶供电。虽然可以使用更小的microUSB电源为Jetson Nano供电,但对于我们项目所需的高GPU计算负载来说,这还不够健壮。此外,本课程还需要使用microUSB端口作为与计算机的直接连接。
The barrel jack must be 5.5mm OD x 2.1mm ID x 9.5mm length, center-positive. As an example of a good power supply, NVIDIA has validated Adafruit’s 5V 4A (4000mA) switching power supply - UL Listed.
筒形千斤顶外径5.5mm,内径2.1mm,长度9.5mm,中心正。作为一个良好电源的例子,NVIDIA已经验证了Adafruit的5V 4A (4000mA)开关电源- UL列出。
2-Pin Jumper
To specify use of the barrel-type power supply on the Jetson Nano Developer Kit, a 2-pin jumper is required. This is an inexpensive item available at many outlets.
要在Jetson Nano开发工具包上指定桶型电源的使用,需要一个2针跳线。这是许多商店都能买到的廉价商品。
Logitech C270 USB Webcam网络摄像头
You'll need a camera to capture images in the course projects. As an example of a compatible camera, NVIDIA has verified that the Logitech C270 USB Webcam works with these projects. The ability to position the camera easily for capturing images hands-free makes this a great choice. Some other USB webcams may also work with the projects. If you already have one on hand, you could test it as an alternative.
在课程设计中,你需要一个相机来捕捉图像。作为兼容摄像头的一个例子,NVIDIA已经验证了Logitech C270 USB网络摄像头可以与这些项目兼容。定位相机的能力,方便地捕捉图像免提使这是一个伟大的选择。其他一些USB网络摄像头也可以与该项目一起工作。如果您手头已经有一个,您可以测试它作为替代。
The Jetson Nano Developer Kit includes a MIPI Camera Serial Interface (CSI) port. As an example of a compatible camera, NVIDIA has verified that theRaspberry Pi Camera Module V2-8 Megapixel,1080p works with these projects.
Jetson Nano开发工具包包括一个MIPI摄像机串行接口(CSI)端口。作为兼容相机的一个例子,NVIDIA已经验证了Raspberry Pi相机模块v2 - 800万像素,1080p可以与这些项目兼容。
Instructions to test both USB and CSI cameras are provided in the Hello Camera lesson.
在Hello Camera教程中提供了测试USB和CSI摄像机的说明。
USB Cable (Micro-B To Type-A) USB线(微型b至a型)
You'll also need a Micro USB to USB-A cable to directly connect your computer to the Jetson Nano Developer Kit's Micro USB port. The cable must be capable of data transfers, rather than only designed to power a device. This is a common cable available at many outlets if you don't already have one on hand.
您还需要一个微型USB到USB-电缆直接连接到您的计算机到Jetson Nano开发工具包的微型USB端口。电缆必须能够传输数据,而不仅仅是为设备供电。如果你没有一个现成的话,这是一种常见的电缆,可在许多插座。
To prepare your microSD card, you’ll need a computer with Internet connection and the ability to read and write SD cards, either via a built-in SD card slot or adapter.
要准备你的microSD卡,你需要一台可以上网的电脑,并且能够读写SD卡,可以通过内置的SD卡插槽或适配器。
INSTRUCTIONS FOR WINDOWS
Format your microSD card using SD Memory Card Formatter from the SD Association.
使用SD协会的SD存储卡格式化程序格式化microSD卡。
Use Etcher to write the Jetson Nano Developer Kit SD Card Image to your microSD card
使用Etcher 将Jetson Nano开发人员工具包SD卡映像写入microSD卡
INSTRUCTIONS FOR MAC
更多参考……
INSTRUCTIONS FOR LINUX
更多参考……
For this course, we are running the Jetson Nano Developer Kit in a "headless" configuration. That means you do not hook up a monitor directly to the Jetson Nano Developer Kit. This method conserves memory resources on the Jetson Nano and has the added benefit of eliminating the requirement for extra hardware, i.e. a monitor, keyboard, and mouse.
在本课程中,我们将以“headless”配置运行Jetson Nano开发人员工具包。这意味着您不需要将监视器直接连接到Jetson Nano开发人员工具包。这种方法节省了Jetson Nano上的内存资源,而且还有一个额外的好处,那就是不需要额外的硬件,比如显示器、键盘和鼠标。
In addition, we will further simplify the configuration by using "USB Device Mode". In this mode, your Jetson Nano Developer Kit connects directly to your computer through a USB cable. This eliminates the need for a network connection on the Jetson Nano, as well as the need to determine the IP address on your network. It is always 192.168.55.1:8888
in this mode.
此外,我们还将使用“USB设备模式”进一步简化配置。在这种模式下,您的Jetson Nano开发工具包通过USB电缆直接连接到您的计算机。这样就不需要在Jetson Nano上建立网络连接,也不需要确定网络上的IP地址。在这种模式下,地址一直是192.168.55.1:8888。
In the steps that follow, you will boot the Jetson Nano in the minimum configuration (without a camera) to make sure it boots correctly from the microSD card you flashed with the DLI course image.
在接下来的步骤中,您将以最小配置启动Jetson Nano(没有摄像头),以确保它正确地从与DLI课程图像一起闪烁的microSD卡引导。
dlinano
输入密码:dlinanoYou will see this screen. Congratulations!
Now that you've verified that your system can boot to your Jetson Nano Developer Kit with the microSD card, let's add the camera! Power down the Jetson Nano Developer Kit by unplugging the power. Then connect the camera using the instructions below for your type of camera (Logitech C270 or Raspberry Pi v2).
现在,您已经验证了您的系统可以使用microSD卡引导到Jetson Nano开发人员工具包,让我们添加相机!拔掉电源,关掉Jetson Nano开发工具包。然后使用下面针对您的相机类型(Logitech C270或Raspberry Pi v2)的说明连接相机。
This is very straightforward. Just plug in the USB connector into any of the Jetson Nano Developer Kit USB ports.
这很简单。只需将USB连接器插入任何Jetson Nano开发人员Kit USB端口。
连接Raspberry Pi V2相机
Other cameras may also work with your Jetson Nano Developer Kit. You'll need to test them to find out. If you have another camera on hand, such as a USB webcam, feel free to give it a try using the "Hello Camera" test notebooks in the next lesson.
其他相机也可以与您的Jetson Nano开发工具包一起使用。你需要测试他们来找出答案。如果你手头有另一个相机,比如USB网络摄像头,请在下节课中使用“Hello camera”测试笔记本试试。
sudo systemctl restart nvargus-daemon
in the terminal window. You will be prompted for the password, which is dlinano
Now with the camera attached, boot the system using headless Device Mode as you did before.
现在有了摄像头,像以前一样使用 headless 设备模式启动系统。
192.168.55.1:8888
The JupyterLab interface is a dashboard that provides access to the Jupyter interactive notebooks and the operating system for Jetson Nano. The first view you'll see includes a directory tree on the left and a "Launcher" page on the right. To open the "Hello Camera" notebook:
JupyterLab接口是一个仪表板,提供访问Jupyter交互式笔记本和Jetson Nano操作系统的权限。您将看到的第一个视图包括左边的目录树和右边的“Launcher”页面。打开“相机你好”笔记本:
nvdli-nano
folder with a double-clickhello_camera
folder in the same wayusb_camera.ipynb
notebook to open it. If you are testing a CSI camera, double-click the csi_camera.ipynb
instead.
For this course, your Jetson Nano has been configured to run a JupyterLab server on port 8888
. When you boot the system and open a browser to the Jetson Nano IP address at that port, you see the JupyterLab interface.
在本课程中,您的Jetson Nano已配置为在端口8888上运行JupyterLab terlab服务器。当您启动系统并打开浏览器到该端口的Jetson Nano IP地址时,您将看到JupyterLab接口。
The JupyterLab Interface is a dashboard that provides access to interactive iPython notebooks, as well as the folder structure for your Jetson Nano and a terminal window into the Ubuntu operating system. The first view you'll see includes a menu bar at the top, a directory tree in the left sidebar, and a main work area that is initially open to the "Launcher" page.
JupyterLab接口是一个仪表板,提供了访问交互式iPython笔记本、Jetson Nano的文件夹结构以及Ubuntu操作系统的终端窗口。您将看到的第一个视图包括顶部的菜单栏、左侧侧边栏中的目录树和最初打开到“Launcher”页面的主工作区。
Complete details for all the features and menu actions available can be found in the JupyterLab Interface document. Here are some key capabilities that will be especially useful in this course:
所有功能和菜单操作的完整细节可以在JupyterLab接口文档中找到。以下是一些在本课程中特别有用的关键功能:
File browser: 文件浏览器:
The file browser in the left sidebar allows navigation through the Jetson Nano file structure. Double-clicking on a notebook or file opens it in the main work area.
左侧侧边栏中的文件浏览器允许导航通过Jetson Nano文件结构。双击笔记本或文件,就会在主工作区打开它。
iPython notebooks: iPython笔记本:
The interactive notebooks used in this course have an ".ipynb" file extension. When a notebook is double-clicked from the file browser, it will open in the main work area and its process will start. The notebooks consist of text and code "cells". When a code cell is "run", by clicking the run button at the top of the notebook or the keyboard shortcut [CTRL][ENTER], the block of code in the cell is executed and the output, if there is any, appears below the cell in the notebook. To the left of each executable cell there is an "execution count" or "prompt number" in brackets. If the cell takes more than a few seconds to run, you will see an asterisk mark there, indicating that the cell has not finished its execution. Once processing of that cell is finished, a number will show in the brackets.
本课程所使用的互动笔记有一个“。ipynb”文件扩展名。当从文件浏览器双击笔记本时,它将在主工作区打开,并启动进程。笔记本由文本和代码“单元格”组成。当代码单元格“运行”时,通过单击笔记本顶部的运行按钮或键盘快捷键[CTRL][ENTER],执行单元格中的代码块,如果有输出,则显示在笔记本单元格的下方。在每个可执行单元的左边,括号中都有一个“执行计数”或“提示数”。如果计算单元运行时间超过几秒钟,您将在那里看到星号标记,表示计算单元尚未完成其执行。该单元格的处理完成后,方括号中将显示一个数字。
Kernel operations: 内核操作:
The kernel for each running notebook is a separate process that runs the user code. The kernel starts automatically when the notebook is opened from the file browser. The kernel menu on the main menu bar includes commands to shutdown or restart the kernel, which you will need to use periodically. After a kernel shutdown, no code cells can be executed. When a kernel is restarted, all memory is lost regarding imported packages, variable assignments, and so on.
每个运行的笔记本的内核都是一个运行用户代码的独立进程。当从文件浏览器打开笔记本时,内核将自动启动。主菜单栏中的内核菜单包含关闭或重启内核的命令,您需要定期使用这些命令。内核关闭后,不能执行任何代码单元格。当内核重新启动时,所有与导入包、变量赋值等相关的内存都会丢失。
Cell tabs: 单元格选项卡:
You can move any cell to new window tabs in the main work area by right-clicking the cell and selecting "Create New View for Output". This way, you can continue to scroll down the JupyterLab notebook while still watching a particular cell. This is especially helpful in the cell includes a camera view!
您可以通过右键单击单元格并选择“为输出创建新视图”,将任何单元格移动到主工作区中的新窗口选项卡。通过这种方式,您可以继续向下滚动JupyterLab笔记本,同时仍然可以查看特定的单元格。这是特别有用的,在单元格中包括一个相机视图!
Terminal window: 终端窗口:
You can work directly in a Terminal window on your Jetson Nano Ubuntu OS. From the Launcher page, click the Terminal icon under "Other". To bring up the Launcher page, if it is no longer visible, click the "+" icon at the top of the left sidebar.
您可以直接在Jetson Nano Ubuntu操作系统的终端窗口中工作。从启动页面,点击“其他”下的终端图标。要打开启动器页面,如果它不再可见,单击左边栏顶部的“+”图标。