x2paddle_model_zoo.md 4.3 KB
Newer Older
J
Jason 已提交
1 2 3
目前X2Paddle支持40+的TensorFlow OP,40+的Caffe Layer,覆盖了大部分CV分类模型常用的操作。我们在如下模型列表中测试了X2Paddle的转换。

受限于不同框架的差异,部分模型可能会存在目前无法转换的情况,如TensorFlow中包含控制流的模型,NLP模型等。对于CV常见的模型,如若您发现无法转换或转换失败,存在较大diff等问题,欢迎通过[ISSUE反馈](https://github.com/PaddlePaddle/X2Paddle/issues/new)的方式告知我们(模型名,代码实现或模型获取方式),我们会即时跟进:)
J
Jason 已提交
4 5 6 7 8 9 10 11

# TensorFlow

| 模型 | 代码 |
|------|----------|
| SqueezeNet | [code](https://github.com/tensorflow/tpu/blob/master/models/official/squeezenet/squeezenet_model.py)|
| MobileNet_V1 | [code](https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet_v1.md) |
| MobileNet_V2 | [code](https://github.com/tensorflow/models/tree/master/research/slim/nets/mobilenet) |
J
Jason 已提交
12
| ShuffleNet | [code](https://github.com/TropComplique/shufflenet-v2-tensorflow) |
J
Jason 已提交
13 14 15 16 17 18 19 20 21 22 23
| mNASNet | [code](https://github.com/tensorflow/tpu/tree/master/models/official/mnasnet) |
| EfficientNet | [code](https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet) |
| Inception_V4 | [code](https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_v4.py) |
| Inception_ResNet_V2 | [code](https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_resnet_v2.py) |
| VGG16 | [code](https://github.com/tensorflow/models/blob/master/research/slim/nets/vgg.py) |
| ResNet_V1_101 | [code](https://github.com/tensorflow/models/blob/master/research/slim/nets/resnet_v1.py) |
| ResNet_V2_101 | [code](https://github.com/tensorflow/models/blob/master/research/slim/nets/resnet_v2.py) |

# Caffe

| 模型 | 代码 |
J
Jason 已提交
24
|-------|--------|
J
Jason 已提交
25 26 27
| SqueezeNet | [code](https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1) |
| MobileNet_V1 | [code](https://github.com/shicai/MobileNet-Caffe) |
| MobileNet_V2 | [code](https://github.com/shicai/MobileNet-Caffe) |
J
Jason 已提交
28
| ShuffleNet | [code](https://github.com/miaow1988/ShuffleNet_V2_pytorch_caffe/releases/tag/v0.1.0) |
J
Jason 已提交
29 30
| mNASNet | [code](https://github.com/LiJianfei06/MnasNet-caffe) |
| MTCNN | [code](https://github.com/kpzhang93/MTCNN_face_detection_alignment/tree/master/code/codes/MTCNNv1/model) |
C
channingss 已提交
31 32 33 34

# ONNX

| 模型 | 来源 | operator version|
C
channingss 已提交
35
|-------|--------|---------|
C
channingss 已提交
36 37 38 39 40 41
| Resnet18 | [torchvison.model.resnet18](https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py) |9|
| Resnet34 | [torchvison.model.resnet34](https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py) |9|
| Resnet50 | [torchvison.model.resnet50](https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py) |9|
| Resnet101 | [torchvison.model.resnet101](https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py) |9|
| Vgg11 | [torchvison.model.vgg11](https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py) |9|
| Vgg11_bn | [torchvison.model.vgg11_bn](https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py) |9|
C
channingss 已提交
42
| Vgg19| [torchvison.model.vgg19](https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py) |9|
C
channingss 已提交
43
| Densenet121 | [torchvison.model.densenet121](https://github.com/pytorch/vision/blob/master/torchvision/models/densenet.py) |9|
C
channingss 已提交
44
| Alexnet | [torchvison.model.alexnet](https://github.com/pytorch/vision/blob/master/torchvision/models/alexnet.py) |9|
C
channingss 已提交
45 46
| Shufflenet | [onnx official](https://github.com/onnx/models/tree/master/vision/classification/shufflenet) |9|
| Inception_v2 | [onnx official](https://github.com/onnx/models/tree/master/vision/classification/inception_and_googlenet/inception_v2) |9|
C
channingss 已提交
47
| Mobilenet_v2 | [pytorch(personal practice)](https://github.com/tonylins/pytorch-mobilenet-v2) |9|
C
channingss 已提交
48

J
Jason 已提交
49
目前onnx2paddle主要支持onnx operator version 9;  
C
channingss 已提交
50
如何将torchvison或者个人开发者写的pytroch model转换成onnx model:
C
channingss 已提交
51 52 53
```
import torch
import torchvision
C
channingss 已提交
54 55 56

#根据不同模型调整输入的shape
dummy_input = torch.randn(1, 3, 224, 224)
C
channingss 已提交
57 58

#预训练后的pytorch model
C
channingss 已提交
59
resnet18 = torchvision.models.resnet18(pretrained=True)
C
channingss 已提交
60

C
channingss 已提交
61
#"resnet18.onnx"为onnx model的存储路径,1.1
C
channingss 已提交
62
torch.onnx.export(resnet18, dummy_input, "resnet18.onnx",verbose=True)
C
channingss 已提交
63 64

```