Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
X2Paddle
提交
8b31fef2
X
X2Paddle
项目概览
PaddlePaddle
/
X2Paddle
大约 1 年 前同步成功
通知
328
Star
698
Fork
167
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
26
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
X2Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
26
Issue
26
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8b31fef2
编写于
5月 14, 2021
作者:
S
SunAhong1993
提交者:
GitHub
5月 14, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the docs (#572)
上级
af4654b6
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
161 addition
and
120 deletion
+161
-120
README.md
README.md
+1
-1
docs/inference_model_convertor/FAQ.md
docs/inference_model_convertor/FAQ.md
+2
-2
docs/inference_model_convertor/op_list.md
docs/inference_model_convertor/op_list.md
+0
-0
docs/introduction/x2paddle_model_zoo.md
docs/introduction/x2paddle_model_zoo.md
+2
-3
docs/pytorch_project_convertor/API_docs/README.md
docs/pytorch_project_convertor/API_docs/README.md
+7
-13
docs/pytorch_project_convertor/API_docs/loss/README.md
docs/pytorch_project_convertor/API_docs/loss/README.md
+2
-1
docs/pytorch_project_convertor/API_docs/nn/README.md
docs/pytorch_project_convertor/API_docs/nn/README.md
+3
-1
docs/pytorch_project_convertor/API_docs/ops/README.md
docs/pytorch_project_convertor/API_docs/ops/README.md
+2
-1
docs/pytorch_project_convertor/API_docs/utils/README.md
docs/pytorch_project_convertor/API_docs/utils/README.md
+2
-1
docs/pytorch_project_convertor/API_docs/vision/README.md
docs/pytorch_project_convertor/API_docs/vision/README.md
+2
-1
docs/pytorch_project_convertor/README.md
docs/pytorch_project_convertor/README.md
+2
-2
docs/pytorch_project_convertor/demo/README.md
docs/pytorch_project_convertor/demo/README.md
+9
-0
docs/pytorch_project_convertor/demo/stargan.md
docs/pytorch_project_convertor/demo/stargan.md
+0
-91
docs/pytorch_project_convertor/demo/ultra_light_fast_generic_face_detector.md
..._convertor/demo/ultra_light_fast_generic_face_detector.md
+89
-0
docs/pytorch_project_convertor/supported_API.md
docs/pytorch_project_convertor/supported_API.md
+38
-3
未找到文件。
README.md
浏览文件 @
8b31fef2
...
...
@@ -97,7 +97,7 @@ x2paddle --convert_torch_project --project_dir=torch_project --save_dir=paddle_p
## 转换教程
1.
[
TensorFlow预测模型转换教程
](
./docs/inference_model_convertor/demo/tensorflow2paddle.ipynb
)
2.
[
PyTorch预测模型转换教程
](
./docs/inference_model_convertor/demo/pytorch2paddle.ipynb
)
3.
[
PyTorch训练项目转换教程
](
./docs/pytorch_project_convertor/demo.md
)
3.
[
PyTorch训练项目转换教程
](
./docs/pytorch_project_convertor/demo
/README
.md
)
## 更新历史
**2020.12.09**
...
...
docs/inference_model_convertor/FAQ.md
浏览文件 @
8b31fef2
...
...
@@ -33,5 +33,5 @@ out =main(ipt)
```
> 若运行代码无误,则说明代码中有op不支持动转静,我们将会再未来支持;若报错,则说明pytorch2paddle转换出错,请提issue,我们将及时回复。
**Q5. 目前支持了哪些op的转换呢?**
A: 可详见
[
X2Paddle支持的op列表
](
./docs/in
troduction
/op_list.md
)
。
**Q5. 目前支持了哪些op的转换呢?**
A: 可详见
[
X2Paddle支持的op列表
](
./docs/in
ference_model_convertor
/op_list.md
)
。
docs/in
troduction
/op_list.md
→
docs/in
ference_model_convertor
/op_list.md
浏览文件 @
8b31fef2
文件已移动
docs/introduction/x2paddle_model_zoo.md
浏览文件 @
8b31fef2
...
...
@@ -103,8 +103,7 @@
## PyTorch训练项目
| 模型 | 转换前代码 | 转换后代码 |
|------|----------|------|
| StaGAN |
[
code
](
https://github.com/yunjey/stargan
)
|
[
code
](
https://github.com/SunAhong1993/stargan/tree/paddle
)
|
| Sta
r
GAN |
[
code
](
https://github.com/yunjey/stargan
)
|
[
code
](
https://github.com/SunAhong1993/stargan/tree/paddle
)
|
| Ultra-Light-Fast-Generic-Face-Detector |
[
code
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB
)
|
[
code
](
https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/paddle
)
|
**注:**
受限于不同框架的差异,部分模型可能会存在目前无法转换的情况,如TensorFlow中包含控制流的模型,NLP模型等。对于CV常见的模型,如若您发现无法转换或转换失败,存在较大diff等问题,欢迎通过
[
ISSUE反馈
](
https://github.com/PaddlePaddle/X2Paddle/issues/new
)
的方式告知我们(模型名,代码实现或模型获取方式),我们会及时跟进:
**注:**
受限于不同框架的差异,部分预测模型可能会存在目前无法转换的情况,如TensorFlow中包含控制流的模型等。对于常见的预测模型或PyTorch项目,如若您发现无法转换或转换失败,存在较大diff等问题,欢迎通过
[
ISSUE反馈
](
https://github.com/PaddlePaddle/X2Paddle/issues/new
)
的方式告知我们(模型名,代码实现或模型获取方式),我们会及时跟进。
docs/pytorch_project_convertor/API_docs/README.md
浏览文件 @
8b31fef2
# PyTorch-PaddlePaddle API对应表
本文档梳理了常用PyTorch 1.8.1 API与PaddlePaddle 2.0.0 API对应关系和差异分析。根据文档对应关系,有PyTorch使用经验的用户,可根据对应关系,快速熟悉PaddlePaddle的API使用。
## [基础操作类](./ops/README.md)
## [组网类](./nn/README.md)
## [Loss类](./loss/README.md)
## [工具类](./utils/README.md)
## [视觉类](./vision/README.md)
***持续更新...**
*
| 类别 | 链接 |
| ---------- | ------------------------- |
| 基础操作类 |
[
映射表
](
./ops/README.md
)
|
| 组网类 |
[
映射表
](
./nn/README.md
)
|
| Loss类 |
[
映射表
](
./loss/README.md
)
|
| 工具类 |
[
映射表
](
./utils/README.md
)
|
| 视觉类 |
[
映射表
](
./vision/README.md
)
|
docs/pytorch_project_convertor/API_docs/loss/README.md
浏览文件 @
8b31fef2
***持续更新...**
*
## Loss类
## Loss类API映射列表
该文档梳理了计算loss相关的PyTorch-PaddlePaddle API映射列表。
| 序号 | PyTorch API | PaddlePaddle API | 备注 |
| ---- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 1 |
[
torch.nn.L1Loss
](
https://pytorch.org/docs/stable/generated/torch.nn.L1Loss.html?highlight=l1loss#torch.nn.L1Loss
)
|
[
paddle.nn.loss.L1Loss
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/layer/loss/L1Loss_cn.html#l1loss
)
| 功能一致,PyTroch存在废弃参数
`size_average`
和
`reduce`
。 |
...
...
docs/pytorch_project_convertor/API_docs/nn/README.md
浏览文件 @
8b31fef2
## 组网类
## 组网类API映射列表
该文档梳理了与构造网络相关的PyTorch-PaddlePaddle API映射列表。
| 序号 | PyTorch API | PaddlePaddle API | 备注 |
| ---- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
...
...
docs/pytorch_project_convertor/API_docs/ops/README.md
浏览文件 @
8b31fef2
## PyTorch-PaddlePaddle 基础操作类API对应表
## 基础操作类API映射列表
该文档梳理了基础操作的PyTorch-PaddlePaddle API映射列表,主要包括了构造Tensor、数学计算、逻辑计算相关的API。
| 序号 | PyTorch API | PaddlePaddle API | 备注 |
| ---- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
...
...
docs/pytorch_project_convertor/API_docs/utils/README.md
浏览文件 @
8b31fef2
## 工具类
## 工具类API映射列表
该文档梳理了与数据处理、分布式处理等相关的PyTorch-PaddlePaddle API映射列表。
| 序号 | PyTorch API | PaddlePaddle API | 备注 |
| ---- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 1 |
[
torch.nn.DataParallel
](
https://pytorch.org/docs/stable/generated/torch.nn.DataParallel.html?highlight=dataparallel#torch.nn.DataParallel
)
|
[
paddle.DataParallel
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/fluid/dygraph/parallel/DataParallel_cn.html#dataparallel
)
|
[
差异对比
](
torch.nn.DataParallel.md
)
|
...
...
docs/pytorch_project_convertor/API_docs/vision/README.md
浏览文件 @
8b31fef2
## 视觉类
## 视觉类
API映射列表
该文档梳理了与视觉处理相关的PyTorch-PaddlePaddle API映射列表。
| 序号 | PyTorch API | PaddlePaddle API | 备注 |
| ---- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------- |
| 1 |
[
torchvision.transforms.Compose
](
https://pytorch.org/vision/stable/transforms.html?highlight=compose#torchvision.transforms.Compose
)
|
[
paddle.vision.transforms.Compose
](
https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/vision/transforms/transforms/Compose_cn.html#compose
)
| 功能一致 |
...
...
docs/pytorch_project_convertor/README.md
浏览文件 @
8b31fef2
...
...
@@ -12,7 +12,7 @@
```
shell
x2paddle
--convert_torch_project
--project_dir
=
torch_project
--save_dir
=
paddle_project
--pretrain_model
=
model.pth
```
| 参数 | |
| 参数 |
作用
|
|----------|--------------|
|--convert_torch_project | 当前方式为对PyTorch Project进行转换 |
|--project_dir | PyTorch的项目路径 |
...
...
@@ -23,4 +23,4 @@ x2paddle --convert_torch_project --project_dir=torch_project --save_dir=paddle_p
### 第三步:转换后代码后处理
PaddlePaddle在使用上有部分限制(例如:自定义Dataset必须继承自
`paddle.io.Dataset`
、部分情况下DataLoader的num_worker只能为0等),用户需要手动修改代码,使代码运行,具体可参见
[
转换后代码后处理
](
./after_convert.md
)
。
***[注意]**
*
转换前后相应操作可以参考
[
转换示例
](
./demo.md
)
***[注意]**
*
转换前后相应操作可以参考
[
转换示例
](
./demo
/README
.md
)
docs/pytorch_project_convertor/demo/README.md
0 → 100644
浏览文件 @
8b31fef2
# PyTorch项目转换教程
| 模型 | 转换教程| 转换前代码 | 转换后代码 |
|------|-----|----------|------|
| StaGAN |
[
demo
](
stargan.md
)
|
[
code
](
https://github.com/yunjey/stargan
)
|
[
code
](
https://github.com/SunAhong1993/stargan/tree/paddle
)
|
| Ultra-Light-Fast-Generic-Face-Detector |
[
demo
](
ultra_light_fast_generic_face_detector.md
)
|
[
code
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB
)
|
[
code
](
https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/paddle
)
|
***持续更新...**
*
docs/pytorch_project_convertor/demo.md
→
docs/pytorch_project_convertor/demo
/stargan
.md
浏览文件 @
8b31fef2
# PyTorch项目转换示例
## [StarGAN](https://github.com/yunjey/stargan)
### 准备工作
```
shell
...
...
@@ -105,93 +104,3 @@ python main.py --mode train --dataset CelebA --image_size 128 --c_dim 5 --sample
```
***转换后的代码可在[这里](https://github.com/SunAhong1993/stargan/tree/paddle)进行查看。**
*
## [Ultra-Light-Fast-Generic-Face-Detector](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB)
### 准备工作
1.
下载项目
```
shell
# 下载项目
git clone https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB.git
git checkout 492a02471671b49c56be8d90cda54c94749d2980
```
2.
根据Generate VOC format training data set and training process的README.md所示下载数据集,并存放于Ultra-Light-Fast-Generic-Face-Detector-1MB/data/文件夹下。
### 第一步:转换前代码预处理
1.
将代码中的
[
或操作符
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/master/vision/utils/box_utils.py#L153
)
替换为如下代码:
```
python
...
def
hard_negative_mining
(
loss
,
labels
,
neg_pos_ratio
):
...
# return pos_mask | neg_mask
return
torch
.
bitwise_or
(
pos_mask
,
neg_mask
)
...
```
2.
使自定义的
[
`DataSet`
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/master/vision/datasets/voc_dataset.py#L10
)
继承
`torch.utils.data.Dataset`
,同时由于代码未导入torch,要添加相关导入的包,修改为如下代码:
```
python
...
# 导入torch
import
torch
...
# class VOCDataset
class
VOCDataset
(
torch
.
utils
.
data
.
Dataset
):
...
...
```
3.
将
[
数据预处理
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/master/vision/utils/box_utils.py#L126
)
Tensor与int型对比,修改为Tensor与Tensor对比,修改如下:
```
python
...
def
assign_priors
(
gt_boxes
,
gt_labels
,
corner_form_priors
,
iou_threshold
):
...
# labels[best_target_per_prior < iou_threshold] = 0 # the backgournd id
# 将原来的赋值修改为7-8行
iou_threshold_tensor
=
torch
.
full_like
(
best_target_per_prior
,
iou_threshold
)
labels
[
best_target_per_prior
<
iou_threshold_tensor
]
=
0
boxes
=
gt_boxes
[
best_target_per_prior_index
]
return
boxes
,
labels
...
```
### 第二步:转换
```
shell
x2paddle
--convert_torch_project
--project_dir
=
Ultra-Light-Fast-Generic-Face-Detector-1MB
--save_dir
=
paddle_project
```
### 第三步:转换后代码后处理
**需要修改的文件位于paddle_project文件夹中,其中文件命名与原始Ultra-Light-Fast-Generic-Face-Detector-1MB文件夹中文件命名一致。**
1.
DataLoader的
`num_workers`
设置为0,在转换后的
[
train-version-RFB.sh处
](
https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/paddle/train-version-RFB.sh#L27
)
设置强制设置
`num_workers`
,具体添加代码如下:
```
shell
...
--num_workers
\
#4 \
0
\
...
```
2.
修改自定义Dataset中的
[
\_\_getitem\_\_的返回值
](
https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/paddle/vision/datasets/voc_dataset.py#L56
)
,将Tensor修改为numpy,修改代码如下:
```
python
...
class
VOCDataset
(
data
.
Dataset
):
...
def
__getitem__
(
self
,
index
):
image_id
=
self
.
ids
[
index
]
boxes
,
labels
,
is_difficult
=
self
.
_get_annotation
(
image_id
)
if
not
self
.
keep_difficult
:
boxes
=
boxes
[
is_difficult
==
0
]
labels
=
labels
[
is_difficult
==
0
]
image
=
self
.
_read_image
(
image_id
)
if
self
.
transform
:
image
,
boxes
,
labels
=
self
.
transform
(
image
,
boxes
,
labels
)
if
self
.
target_transform
:
boxes
,
labels
=
self
.
target_transform
(
boxes
,
labels
)
# return image, boxes, labels
# 将原来的return替换为如下17行
return
image
.
numpy
(),
boxes
.
numpy
(),
labels
.
numpy
()
...
```
### 运行训练代码
```
shell
cd
paddle_project/Ultra-Light-Fast-Generic-Face-Detector-1MB
sh train-version-RFB.sh
```
***转换后的代码可在[这里](https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/paddle)进行查看。**
*
docs/pytorch_project_convertor/demo/ultra_light_fast_generic_face_detector.md
0 → 100644
浏览文件 @
8b31fef2
## [Ultra-Light-Fast-Generic-Face-Detector](https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB)
### 准备工作
1.
下载项目
```
shell
# 下载项目
git clone https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB.git
git checkout 492a02471671b49c56be8d90cda54c94749d2980
```
2.
根据Generate VOC format training data set and training process的README.md所示下载数据集,并存放于Ultra-Light-Fast-Generic-Face-Detector-1MB/data/文件夹下。
### 第一步:转换前代码预处理
1.
将代码中的
[
或操作符
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/master/vision/utils/box_utils.py#L153
)
替换为如下代码:
```
python
...
def
hard_negative_mining
(
loss
,
labels
,
neg_pos_ratio
):
...
# return pos_mask | neg_mask
return
torch
.
bitwise_or
(
pos_mask
,
neg_mask
)
...
```
2.
使自定义的
[
`DataSet`
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/master/vision/datasets/voc_dataset.py#L10
)
继承
`torch.utils.data.Dataset`
,同时由于代码未导入torch,要添加相关导入的包,修改为如下代码:
```
python
...
# 导入torch
import
torch
...
# class VOCDataset
class
VOCDataset
(
torch
.
utils
.
data
.
Dataset
):
...
...
```
3.
将
[
数据预处理
](
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/master/vision/utils/box_utils.py#L126
)
Tensor与int型对比,修改为Tensor与Tensor对比,修改如下:
```
python
...
def
assign_priors
(
gt_boxes
,
gt_labels
,
corner_form_priors
,
iou_threshold
):
...
# labels[best_target_per_prior < iou_threshold] = 0 # the backgournd id
# 将原来的赋值修改为7-8行
iou_threshold_tensor
=
torch
.
full_like
(
best_target_per_prior
,
iou_threshold
)
labels
[
best_target_per_prior
<
iou_threshold_tensor
]
=
0
boxes
=
gt_boxes
[
best_target_per_prior_index
]
return
boxes
,
labels
...
```
### 第二步:转换
```
shell
x2paddle
--convert_torch_project
--project_dir
=
Ultra-Light-Fast-Generic-Face-Detector-1MB
--save_dir
=
paddle_project
```
### 第三步:转换后代码后处理
**需要修改的文件位于paddle_project文件夹中,其中文件命名与原始Ultra-Light-Fast-Generic-Face-Detector-1MB文件夹中文件命名一致。**
1.
DataLoader的
`num_workers`
设置为0,在转换后的
[
train-version-RFB.sh处
](
https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/paddle/train-version-RFB.sh#L27
)
设置强制设置
`num_workers`
,具体添加代码如下:
```
shell
...
--num_workers
\
#4 \
0
\
...
```
2.
修改自定义Dataset中的
[
\_\_getitem\_\_的返回值
](
https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/blob/paddle/vision/datasets/voc_dataset.py#L56
)
,将Tensor修改为numpy,修改代码如下:
```
python
...
class
VOCDataset
(
data
.
Dataset
):
...
def
__getitem__
(
self
,
index
):
image_id
=
self
.
ids
[
index
]
boxes
,
labels
,
is_difficult
=
self
.
_get_annotation
(
image_id
)
if
not
self
.
keep_difficult
:
boxes
=
boxes
[
is_difficult
==
0
]
labels
=
labels
[
is_difficult
==
0
]
image
=
self
.
_read_image
(
image_id
)
if
self
.
transform
:
image
,
boxes
,
labels
=
self
.
transform
(
image
,
boxes
,
labels
)
if
self
.
target_transform
:
boxes
,
labels
=
self
.
target_transform
(
boxes
,
labels
)
# return image, boxes, labels
# 将原来的return替换为如下17行
return
image
.
numpy
(),
boxes
.
numpy
(),
labels
.
numpy
()
...
```
### 运行训练代码
```
shell
cd
paddle_project/Ultra-Light-Fast-Generic-Face-Detector-1MB
sh train-version-RFB.sh
```
***转换后的代码可在[这里](https://github.com/SunAhong1993/Ultra-Light-Fast-Generic-Face-Detector-1MB/tree/paddle)进行查看。**
*
docs/pytorch_project_convertor/supported_API.md
浏览文件 @
8b31fef2
# PyTorch训练项目转换支持API列表
> 目前PyTorch训练项目转换支持6个优化器相关API,
40+的NN类API,5个Utils类API,2个Autograd类API,40+的基础操作API以及1
0+Torchvision API,我们在如下列表中给出了目前的全部API。
> 目前PyTorch训练项目转换支持6个优化器相关API,
70+的NN类API,10+Utils类API,2个Autograd类API,40+的基础操作API以及3
0+Torchvision API,我们在如下列表中给出了目前的全部API。
## 优化器相关API
| 序号 | API | 序号 | API |
...
...
@@ -35,7 +35,22 @@
| 41 | torch.nn.functional.softmax | 42 | torch.nn.init.xavier_uniform_ |
| 43 | torch.nn.functional.binary_cross_entropy_with_logits | 44 | torch.nn.functional.cross_entropy |
| 45 | torch.nn.functional.dropout | 46 | torch.nn.functional.relu |
| 47 | torch.nn.functional.smooth_l1_loss | | |
| 47 | torch.nn.functional.smooth_l1_loss | 48 | torch.nn.AdaptiveAvgPool1d |
| 49 | torch.nn.AdaptiveAvgPool2d | 50 | torch.nn.AdaptiveAvgPool3d |
| 51 | torch.nn.AvgPool1d | 52 | torch.nn.AvgPool2d |
| 53 | torch.nn.AvgPool3d | 54 | torch.nn.ConstantPad2d |
| 55 | torch.nn.Dropout2d | 56 | torch.nn.GELU |
| 57 | torch.nn.GroupNorm | 58 | torch.nn.Identity |
| 59 | torch.nn.LayerNorm | 60 | torch.nn.MaxUnpool2d |
| 61 | torch.nn.ReflectionPad2d | 62 | torch.nn.ReplicationPad2d |
| 63 | torch.nn.PReLU | 64 | torch.nn.SyncBatchNorm |
| 65 | torch.nn.ZeroPad2d | 66 | torch.nn.KLDivLoss |
| 67 | torch.nn.L1Loss | 68 | paddle.nn.functional.interpolate |
| 69 | torch.nn.functional.mse_loss | 70 | torch.nn.init.constant_ |
| 71 | torch.nn.init.normal_ | 72 | torch.nn.init.ones_ |
| 73 | torch.nn.init.zeros_ | 74 | torch.nn.init.orthogonal_ |
## Utils类API
...
...
@@ -43,7 +58,11 @@
| ---- | ------------------------------ | ---- | --------------------------- |
| 1 | torch.utils.data | 2 | torch.utils.data.DataLoader |
| 3 | torch.utils.data.random_split | 4 | torch.utils.data.Dataset |
| 5 | torch.utils.data.ConcatDataset | | |
| 5 | torch.utils.data.ConcatDataset | 6 | torch.utils.data.distributed |
| 7 | torch.utils.data.distributed.DistributedSampler | 8 | torch.utils.model_zoo |
| 9 | torch.utils.model_zoo.load_url | 10 | torch.multiprocessing |
| 11 | torch.multiprocessing.spawn | 12 | torch.distributed |
| 13 | torch.distributed.init_process_group | 14 | |
## Autograd类API
...
...
@@ -76,6 +95,9 @@
| 37 | torch.rand | 38 | torch.abs |
| 39 | torch.bitwise_or | 40 | torch.bitwise_xor |
| 41 | torch.bitwise_and | 42 | torch.bitwise_not |
| 43 | torch.randn | 44 | torch.add |
| 45 | torch.mul | 46 | torch.linspace |
| 47 | torch.einsum| | |
## Torchvision API
...
...
@@ -86,5 +108,18 @@
| 5 | torchvision.transforms.ToTensor | 6 | torchvision.transforms.RandomHorizontalFlip |
| 7 | torchvision.transforms.CenterCrop | 8 | torchvision.transforms.Normalize |
| 9 | torchvision.utils.save_image | 10 | torchvision.datasets.ImageFolder |
| 11 | torchvision.transforms.RandomResizedCrop | 12 | torchvision.transforms.Lambda |
| 13 | torchvision.utils | 14 | torchvision.utils.save_image |
| 15 | torchvision.datasets | 16 | torchvision.datasets.ImageFolder |
| 17 | torchvision.models | 18 | torchvision.models.vgg_pth_urls |
| 19 | torchvision.models.vgg11 | 20 | torchvision.models.vgg13 |
| 21 | torchvision.models.vgg16 | 22 | torchvision.models.vgg19 |
| 23 | torchvision.models.vgg11_bn | 24 | torchvision.models.vgg13_bn |
| 25 | torchvision.models.vgg16_bn | 26 | torchvision.models.vgg19_bn |
| 27 | torchvision.models.resnet34 | 28 | torchvision.models.resnet50 |
| 29 | torchvision.models.resnet101 | 30 | torchvision.models.resnet152 |
| 31 | torchvision.models.resnext50_32x4d | 32 | torchvision.models.resnext101_32x8d |
| 33 | torchvision.models.wide_resnet50_2 | 34 | torchvision.models.wide_resnet101_2 |
***持续更新...**
*
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录