반응형
블로그 이미지
개발자로서 현장에서 일하면서 새로 접하는 기술들이나 알게된 정보 등을 정리하기 위한 블로그입니다. 운 좋게 미국에서 큰 회사들의 프로젝트에서 컬설턴트로 일하고 있어서 새로운 기술들을 접할 기회가 많이 있습니다. 미국의 IT 프로젝트에서 사용되는 툴들에 대해 많은 분들과 정보를 공유하고 싶습니다.
솔웅

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

카테고리


반응형

https://d2l.ai/chapter_installation/index.html

 

Installation — Dive into Deep Learning 1.0.3 documentation

 

d2l.ai

 

Installation

 

In order to get up and running, we will need an environment for running Python, the Jupyter Notebook, the relevant libraries, and the code needed to run the book itself.

 

시작하고 실행하려면 Python을 실행하기 위한 환경, Jupyter Notebook, 관련 라이브러리 및 책 자체를 실행하는 데 필요한 코드가 필요합니다.

 

Installing Miniconda

 

 

Your simplest option is to install Miniconda. Note that the Python 3.x version is required. You can skip the following steps if your machine already has conda installed.

 

가장 간단한 옵션은 Miniconda를 설치하는 것입니다. Python 3.x 버전이 필요합니다. 컴퓨터에 이미 conda가 설치되어 있으면 다음 단계를 건너뛸 수 있습니다.

 

Visit the Miniconda website and determine the appropriate version for your system based on your Python 3.x version and machine architecture. Suppose that your Python version is 3.9 (our tested version). If you are using macOS, you would download the bash script whose name contains the strings “MacOSX”, navigate to the download location, and execute the installation as follows (taking Intel Macs as an example):

 

Miniconda 웹사이트를 방문하여 Python 3.x 버전과 머신 아키텍처를 기반으로 시스템에 적합한 버전을 결정하세요. Python 버전이 3.9(테스트된 버전)라고 가정합니다. macOS를 사용하는 경우 이름에 "MacOSX"라는 문자열이 포함된 bash 스크립트를 다운로드하고 다운로드 위치로 이동한 후 다음과 같이 설치를 실행합니다(Intel Mac을 예로 사용).

 

# The file name is subject to changes
sh Miniconda3-py39_4.12.0-MacOSX-x86_64.sh -b

 

Linux 사용자는 이름에 "Linux"라는 문자열이 포함된 파일을 다운로드하고 다운로드 위치에서 다음을 실행합니다.

 

# The file name is subject to changes
sh Miniconda3-py39_4.12.0-Linux-x86_64.sh -b

 

A Windows user would download and install Miniconda by following its online instructions. On Windows, you may search for cmd to open the Command Prompt (command-line interpreter) for running commands.

 

Windows 사용자는 온라인 지침에 따라 Miniconda를 다운로드하고 설치합니다. Windows에서는 cmd를 검색하여 명령을 실행하기 위한 명령 프롬프트(명령줄 해석기)를 열 수 있습니다.

 

Next, initialize the shell so we can run conda directly.

 

다음으로, conda를 직접 실행할 수 있도록 셸을 초기화합니다.

 

~/miniconda3/bin/conda init

 

Then close and reopen your current shell. You should be able to create a new environment as follows:

 

그런 다음 현재 셸을 닫았다가 다시 엽니다. 다음과 같이 새 환경을 만들 수 있어야 합니다.

 

conda create --name d2l python=3.9 -y

 

Now we can activate the d2l environment:

 

이제 d2l 환경을 활성화할 수 있습니다.

 

conda activate d2l

 

Installing the Deep Learning Framework and the d2l Package

 

Before installing any deep learning framework, please first check whether or not you have proper GPUs on your machine (the GPUs that power the display on a standard laptop are not relevant for our purposes). For example, if your computer has NVIDIA GPUs and has installed CUDA, then you are all set. If your machine does not house any GPU, there is no need to worry just yet. Your CPU provides more than enough horsepower to get you through the first few chapters. Just remember that you will want to access GPUs before running larger models.

 

 

딥 러닝 프레임워크를 설치하기 전에 먼저 컴퓨터에 적절한 GPU가 있는지 확인하십시오(표준 노트북의 디스플레이에 전원을 공급하는 GPU는 우리의 목적과 관련이 없습니다). 예를 들어 컴퓨터에 NVIDIA GPU가 있고 CUDA가 설치되어 있으면 모든 준비가 완료된 것입니다. 컴퓨터에 GPU가 내장되어 있지 않더라도 아직은 걱정할 필요가 없습니다. CPU는 처음 몇 장을 완료하는 데 충분한 마력을 제공합니다. 더 큰 모델을 실행하기 전에 GPU에 액세스해야 한다는 점을 기억하세요.

 

You can install PyTorch (the specified versions are tested at the time of writing) with either CPU or GPU support as follows:

 

다음과 같이 CPU 또는 GPU를 지원하는 PyTorch(지정된 버전은 작성 당시 테스트됨)를 설치할 수 있습니다.

 

pip install torch==2.0.0 torchvision==0.15.1

 

Our next step is to install the d2l package that we developed in order to encapsulate frequently used functions and classes found throughout this book:

 

다음 단계는 이 책 전체에서 자주 사용되는 함수와 클래스를 캡슐화하기 위해 개발한 d2l 패키지를 설치하는 것입니다.

 

pip install d2l==1.0.3

 

Downloading and Running the Code

 

Next, you will want to download the notebooks so that you can run each of the book’s code blocks. Simply click on the “Notebooks” tab at the top of any HTML page on the D2L.ai website to download the code and then unzip it. Alternatively, you can fetch the notebooks from the command line as follows:

 

다음으로, 책의 각 코드 블록을 실행할 수 있도록 노트북을 다운로드하고 싶을 것입니다. D2L.ai 웹사이트의 HTML 페이지 상단에 있는 "노트북" 탭을 클릭하면 코드를 다운로드한 후 압축을 풀 수 있습니다. 또는 다음과 같이 명령줄에서 Notebook을 가져올 수 있습니다.

 

 

mkdir d2l-en && cd d2l-en
curl https://d2l.ai/d2l-en-1.0.3.zip -o d2l-en.zip
unzip d2l-en.zip && rm d2l-en.zip
cd pytorch

 

If you do not already have unzip installed, first run sudo apt-get install unzip. Now we can start the Jupyter Notebook server by running:

 

unzip이 아직 설치되어 있지 않은 경우 먼저 sudo apt-get install unzip을 실행합니다. 이제 다음을 실행하여 Jupyter Notebook 서버를 시작할 수 있습니다.

 

jupyter notebook

 

At this point, you can open http://localhost:8888 (it may have already opened automatically) in your web browser. Then we can run the code for each section of the book. Whenever you open a new command line window, you will need to execute conda activate d2l to activate the runtime environment before running the D2L notebooks, or updating your packages (either the deep learning framework or the d2l package). To exit the environment, run conda deactivate.

 

이 시점에서 웹 브라우저에서 http://localhost:8888(이미 자동으로 열렸을 수 있음)을 열 수 있습니다. 그런 다음 책의 각 섹션에 대한 코드를 실행할 수 있습니다. 새 명령줄 창을 열 때마다 D2L 노트북을 실행하거나 패키지(딥 러닝 프레임워크 또는 d2l 패키지)를 업데이트하기 전에 conda activate d2l을 실행하여 런타임 환경을 활성화해야 합니다. 환경을 종료하려면 conda deactivate를 실행합니다.

 

 

 

 

 

반응형

'Dive into Deep Learning > D2L Preface Installation Notation Intro' 카테고리의 다른 글

D2L - Introduction  (0) 2023.10.09
D2L - Notation  (0) 2023.10.08
D2L - Preface  (1) 2023.10.08