1、安装与使用

首先安装两个库

pip install timm

pip install huggingface_hub

2、创建预训练模型

代码很简单就一句

model = timm.create_model('resnet18', pretrained=True, num_classes=4)

model = timm.create_model("hf_hub:timm/eca_nfnet_l0")

需要什么模型都可以去他们的官网上查看Models - Hugging Face

| [![](https://img-blog.csdnimg.cn/img_convert/5ecf066b6c86db651c102453663c3121.jpeg =100x)](http://www.relxdingyilang.cn/) | [点击访问博客查看更多内容](http://www.relxdingyilang.cn/) |
|------------------------------------------|-- |

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐