当前位置:网站首页>mmclassification安装与调试
mmclassification安装与调试
2022-06-29 06:38:00 【Coding的叶子】
MMClassification 是一款基于 PyTorch 的开源图像分类工具箱,是 OpenMMLab 项目的成员之一 主分支代码目前支持 PyTorch 1.5 以上的版本。 MMClassification包含了诸多经典或高性能图像分类算法,复现了最新的一些论文和成果,特别是包括了大量CVPR论文的复现。
1 项目地址
项目地址:GitHub - open-mmlab/mmclassification: OpenMMLab Image Classification Toolbox and Benchmark
安装指南:
Prerequisites — MMClassification 0.23.1 documentation
Getting Started — MMClassification 0.23.1 documentation
2 安装步骤
mmclassification的安装步骤如下:
conda create -n openmmlab python=3.7 -y
conda activate openmmlab
pip install torch==1.8.1+cu101 torchvision==0.9.1+cu101 torchaudio==0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
pip3 install openmim
mim install mmcv-full
git clone https://github.com/open-mmlab/mmclassification.git
#如果github连接不上,可用gittee替换。
#git clone https://gitee.com/monkeycc/mmclassification.git
cd mmclassification
pip install -v -e .其中,pytorch版本根据自身的cuda版本安装相应的版本即可。如果git无法使用,也可以用浏览器下载后解压。如果Github无法访问,可用gittee替换,即:https://gitee.com/monkeycc/mmclassification.git。
安装过程提示如下图所示,最后会提示安装成功。

3 效果测试
(1)下载预训练模型
运行下面命令下载预训练模型:
mim download mmcls --config resnet50_8xb32_in1k --dest .
运行完之后,在当前目录下会下载到两个文件,即resnet50_8xb32_in1k.py 和resnet50_8xb32_in1k_20210831-ea4938fc.pth。
如果运行文件时,提示search.py抛出如下异常:
TypeError: __init__() got an unexpected keyword argument 'autocompletion'
造成这个错误的原因是click版本不匹配,可以按照下述命令重新安装更低版本的click。
pip install click==7.1.2
修复完上述错误后,search.py文件还会继续报如下错误:
修改python环境中/lib/python3.7/site-packages/mim/commands/search.py文件,这个文件在抱错时也会提示357行抛出异常,错误提示如下所示:
File "/root/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mim/commands/search.py", line 169, in get_model_info
dataframe = convert2df(metadata)
File "/root/anaconda3/envs/openmmlab/lib/python3.7/site-packages/mim/commands/search.py", line 357, in convert2df
for result in results:
TypeError: 'NoneType' object is not iterable
解决方法是在357前增加if results is None: continue。如下所示:
if results is None:
continue
for result in results:(2)运行测试脚本
python demo/image_demo.py demo/demo.JPEG resnet50_8xb32_in1k.py resnet50_8xb32_in1k_20210831-ea4938fc.pth --device cpu运行完成之后,会在命令行输出如下内容:

4 【python三维深度学习】python三维点云从基础到深度学习_Coding的叶子的博客-CSDN博客_python 三维点云
更多三维、二维感知算法和金融量化分析算法请关注“乐乐感知学堂”微信公众号,并将持续进行更新。
边栏推荐
- Digital IC Design - UART
- 大型化工企业数字化转型建议
- Configuring MySQL 5.7 and 8 under CentOS
- Error: GPG check FAILED Once install MySQL
- Redis (4) of NoSQL database: redis new data type
- uva10891
- [QNX Hypervisor 2.2用户手册]6.2.1 Guest之间通信
- WDCP accesses all paths that do not exist and jumps to the home page without returning 404
- Save token get token refresh token send header header
- NoSQL数据库之Redis(五):Redis_Jedis_测试
猜你喜欢

Draw multiple ROC curves on a graph

idea使用

Do you really understand "binder copy once"?

数字ic设计——UART

Spark RDD案例:统计每日新增用户

国内代码托管中心- 码云
![[when OSPF introduces direct connection routes, it makes a summary by using static black hole routes]](/img/a8/f77cc5e43e1885171e73f8ab543ee4.png)
[when OSPF introduces direct connection routes, it makes a summary by using static black hole routes]

Idea use

CI工具Jenkins之二:搭建一个简单的CI项目
![[answer all questions] CSDN question and answer function evaluation](/img/32/571c9c5f4eb7f69173ae79b8dcf427.jpg)
[answer all questions] CSDN question and answer function evaluation
随机推荐
Livedata source code appreciation - basic use
[answer all questions] CSDN question and answer function evaluation
示波器 符号
WDCP accesses all paths that do not exist and jumps to the home page without returning 404
NoSQL数据库介绍
uva11825
把多个ROC曲线画在一张图上
Markdown 技能树(4):链接
存token获取token刷新token发送header头
Uniapp obtains the date implementation of the beginning and end of the previous month and the next month
YGG pilipinas: typhoon Odette disaster relief work update
idea使用
Spark RDD案例:统计每日新增用户
数据库-同义词
Qt 容器类
Redis (4) of NoSQL database: redis new data type
uva10891
通过keyup监听textarea输入更改按钮样式
WordPress adds article topping, password protection, and privacy Tags
Testing grpc service with grpcui