1. 파이토치 개발환경 구축 - Python3.7
페이지 정보
작성자 관리자 댓글 0건 조회 2,254회 작성일 20-02-25 14:27본문
1. 파이토치 개발환경 구축 - Python3.7
1. Python3.7 설치
2. 파이토치 설치
https://pytorch.org/get-started/locally/
웹에서 pip install 명령어를 복사하여 설치한다.
C:\Users\jklee>pip install torch==1.4.0+cpu torchvision==0.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch==1.4.0+cpu
Downloading https://download.pytorch.org/whl/cpu/torch-1.4.0%2Bcpu-cp37-cp37m-win_amd64.whl (77.4MB)
|████████████████████████████████| 77.4MB 1.6MB/s
Collecting torchvision==0.5.0+cpu
Downloading https://download.pytorch.org/whl/cpu/torchvision-0.5.0%2Bcpu-cp37-cp37m-win_amd64.whl (485kB)
|████████████████████████████████| 491kB ...
Requirement already satisfied: six in c:\python\python37\lib\site-packages (from torchvision==0.5.0+cpu) (1.13.0)
Collecting pillow>=4.1.1
Downloading https://files.pythonhosted.org/packages/88/6b/66f502b5ea615f69433ae1e23ec786b2cdadbe41a5cfb1e1fabb4f9c6ce9/Pillow-7.0.0-cp37-cp37m-win_amd64.whl (2.0MB)
|████████████████████████████████| 2.0MB 930kB/s
Requirement already satisfied: numpy in c:\python\python37\lib\site-packages (from torchvision==0.5.0+cpu) (1.18.0)
Installing collected packages: torch, pillow, torchvision
Successfully installed pillow-7.0.0 torch-1.4.0+cpu torchvision-0.5.0+cpu
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\jklee>
추가 라이브러리를 설치한다.
Matplotlib: 그래프 작성용 함수를 제공
Pandas : 데이터를 다루는 함수를 제공
Scikit-learn : 머신러닝 관련 함수를 제공
KoNLPy : 자연어 처리용 함수를 제공
C:\Users\jklee>pip install pandas
C:\Users\jklee>pip install scikit-learn
C:\Users\jklee>pip install matplotlib
C:\Users\jklee>pip install konlpy
C:\Users\jklee>pip install pillow
설치확인을 위해 간단한 예제를 실습해보자.
실습.
# -*- coding: utf-8 -*-
# PyTorch 라이브러리 임포트
import torch
x = torch.randn(3,5)
print(x)
결과.
댓글목록
등록된 댓글이 없습니다.