当前位置:网站首页>【pytorch环境安装搭建】
【pytorch环境安装搭建】
2022-06-13 09:20:00 【LYpokerface】
pytorch安装,简单记录
1.准备好Anaconda环境,官网下载
conda安装完成后,cmd可直接进行conda指令操作
2.环境配置
(1)环境名为paddle ,python版本为3.9,后续深度学习操作在此环境上进行
conda create -n pytorch python=3.9
(2)进入指定环境
conda activate pytorch
(3)pytorch官网按自己配置获得conda下载指令,pytorch官网下载
例如我下载的是cpu版本,建议使用pip下载,用conda因为pytorch服务器在国外会比较慢,conda下载的话,把-c的后缀删了用镜像源快些
pip3 install torch torchvision torchaudio
(4)安装完成后,验证环境是否安装成功
import torch
a = torch.cuda.is_available()
print(a)
激活环境-进入python解释器-加载torch库,没报异常其实就安装成功了
3.下载yolov5源码,在github直接下载
pycharm同样官网下载即可,Pycharm ,用pycharm打开下载的paddledetection工程文件,选择对应的python解释器File-Setting-Project-python interpreter选择conda里的pytorch环境下的python.exe解释器。
下载完成后目录下有requirements.txt,用于安装python其它依赖库,在cmd或者pycharm的控制台下进行安装,我后续控制台操作都是在pycharm下执行,比较方便。
pip install -r requirements.txt
4.测试pytorch-yolov5环境搭建完成
yolov5s.pt是模型权重文件,没有的话需要下载
python detect.py --source data/images/bus.jpg --weights pretrained/yolov5s.pt

边栏推荐
- C language: deep understanding of pointers and arrays
- Exporting MySQL data table documents using Navicat
- Yolov5 face video stream
- 20211108 is transpose multiply a a a positive definite matrix? What are the necessary and sufficient conditions for a to be a positive definite matrix?
- 马斯克的「元宇宙」梦
- C language: summary of question brushing (1)
- 20211104 why are the traces of similar matrices the same
- JUC 字段更新器
- Online debugging tool Arthas Foundation
- C language: five custom types
猜你喜欢

BGP 联邦+Community

Final principle

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

Class loading overview

Jenkins access openldap user authentication

线上调试工具Arthas基础
![[implementation of depth first search]](/img/10/4f150e4fa0d4edf01483a72b881afe.jpg)
[implementation of depth first search]

20211020 academician all drive system

CAS NO lock

Library management system based on wechat applet Rar (thesis + source code)
随机推荐
计算两个时间相差的天数(支持跨月、跨年)
C language: shortcut keys commonly used in VS
QML(06)——qml. Add a new folder under QRC
LeetCode 6098. 统计得分小于 K 的子数组数目(前缀和+二分查找)
图数据库Neo4j介绍
JUC原子整数
Spectre record
Jenkins access openldap user authentication
How to build an aby framework and run an instance
20220524 how to install coppeliasim to disk D
JUC atomic reference and ABA problem
Neo4j環境搭建
Heap
LeetCode 6095. 强密码检验器 II
Cisco, Huawei network equipment
静态变量与一个类相关联,只要该类在内存中(只要您的应用程序终止,该变量就不存在)就可以使用。(堆本体,栈引用)
Tutorial (5.0) 04 Fortint cloud services and scripts * fortiedr * Fortinet network security expert NSE 5
C language: sanziqi
LeetCode 322. 零钱兑换
Class loading overview