当前位置:网站首页>[pytorch environment installation]
[pytorch environment installation]
2022-06-13 09:32:00 【LYpokerface】
pytorch install , Simple record
1. Get ready Anaconda Environmental Science , Download from the official website
conda After installation ,cmd It can be done directly conda Command operation
2. Environment configuration
(1) The environment name is paddle ,python Version is 3.9, Subsequent deep learning operations are carried out in this environment
conda create -n pytorch python=3.9
(2) Enter the designated environment
conda activate pytorch
(3)pytorch Get the official website according to your own configuration conda Download instructions ,pytorch Download from the official website 
For example, I downloaded cpu edition , It is recommended to use pip download , use conda because pytorch Servers are slow in foreign countries ,conda Download , hold -c The suffix of is deleted. It is faster to use the image source
pip3 install torch torchvision torchaudio
(4) After installation , Verify that the environment is installed successfully
import torch
a = torch.cuda.is_available()
print(a)
Activate the environment - Get into python Interpreter - load torch library , In fact, the installation was successful without any exception
3. download yolov5 Source code , stay github Direct download
pycharm Similarly, you can download it from the official website ,Pycharm , use pycharm Open the download paddledetection Engineering documents , Select corresponding python Interpreter File-Setting-Project-python interpreter choice conda Inside pytorch In the environment python.exe Interpreter .
After downloading, there are... In the directory requirements.txt, For installation python Other dependent Libraries , stay cmd perhaps pycharm Install under the console , My subsequent console operations are in pycharm perform , It's more convenient .
pip install -r requirements.txt
4. test pytorch-yolov5 The environment is set up
yolov5s.pt Is a model weight file , If not, you need to download
python detect.py --source data/images/bus.jpg --weights pretrained/yolov5s.pt

边栏推荐
- (dijkstra+ shortest path + edge traversal 0 (m)) acwing 850 Dijkstra finding the shortest path II
- Online debugging tool Arthas advanced
- (dp+ memory) acwing 901 skiing
- C language: deep understanding of character functions and string functions (1)
- LeetCode 6098. Count the number of subarrays whose score is less than K (prefix and + binary search)
- How to build an aby framework and run an instance
- Classes and objects -- encapsulation
- 线上调试工具Arthas基础
- LeetCode 6097. Match after replacing characters (Dictionary)
- Exploitation of competitive loopholes in attacking and defending world PWN play conditions
猜你喜欢

The turtle library displays the system time

全新BMW i3的操控,能符合对3系之名产品的期待吗?

acwing 788. Number of pairs in reverse order

Overloading of typical operators

Can the operation of the new BMW I3 meet the expectations of the famous products of the 3 series?

Class loading overview

Heap

(bfs) acwing 844. Labyrinth

Solov2 source code analysis

C language: dynamic memory management
随机推荐
LeetCode 201. 数字范围按位与
C language: deep understanding of character functions and string functions (1)
(dfs) acwing 842. Arrange numbers
turtle库显示系统时间
C language 7-13 day K candle chart (15 points)
C language: deep understanding of character functions and string functions (2)
C language: Simulated Implementation of library function strcpy
C/s model and P2P model
C language: preprocessing in program environment
C language: summary of question brushing (1)
C language: file operation
阿里高级专家剖析 | Protocol的标准设计
The turtle library displays the system time
Overview of common layers of image recognition neural network (under update)
C language: minesweeping
C language: shortcut keys commonly used in VS
JUC atomic integer
(tree DP) acwing 285 A dance without a boss
Jenkins accédant à l'authentification de l'utilisateur openldap
acwing 786. Number k