mmsegmentation安装教程

本文是基于Annconda下的安装教程,先要把Annconda安装好。
安装好之后打开anaconda prompt控制面板:
在这里插入图片描述

  1. 换成清华源:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    临时换源:pip install <xxx> -i https://pypi.tuna.tsinghua.edu.cn/simple

  2. 创建虚拟环境 :conda create -n mmseg3 python=3.9 ( mmseg3为虚拟环境的名字,指定python版本)

  3. 验证虚拟环境创建成功:conda activate mmseg3 python -V

显示如下即为安装成功:
在这里插入图片描述

  1. 虚拟环境中安装pytorch的相关包:
    pip install torch==1.10.1+cu113 torchvision==0.11.2+cu113 torchaudio==0.10.1+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

安装验证:

(mmseg3) C:\Users\Administrator>python
Python 3.9.17 (main, Jul  5 2023, 20:47:11) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.__version
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'torch' has no attribute '__version'
>>> torch.__version__
'1.10.1+cu113'
>>> exit()
  1. 装mmsegmentation相关的包:
    pip install -U openmim
    mim install mmcv-full

下载mmsegmentation可以用git下载:git clone https://github.com/open-mmlab/mmsegmentation.git
(也可以到网页直接下载下来)

  1. 在控制台进入这个文件夹。用d:进入D盘,然后cd到下载解压后的文件夹中:pip install -v -e .

在这里插入图片描述

mim install mmengine

  1. 测试

mim download mmsegmentation --config pspnet_r50-d8_512x1024_40k_cityscapes --dest .

python demo/image_demo.py demo/demo.png pspnet_r50-d8_512x1024_40k_cityscapes.py pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth --device cpu --out-file result.jpg

在这里插入图片描述

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值