提交 57ab050b 编写于 作者: M ms_yan

repair tutorial import problem

上级 08df6729
...@@ -276,9 +276,9 @@ Data augmentation requires the `map` function. For details about how to use the ...@@ -276,9 +276,9 @@ Data augmentation requires the `map` function. For details about how to use the
1. Import the module to the code. 1. Import the module to the code.
```python ```python
from mindspore.dataset.transforms.vision import Inter
import mindspore.dataset.transforms.vision.c_transforms as transforms import mindspore.dataset.transforms.vision.c_transforms as transforms
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib.image as mpimg
``` ```
2. Define data augmentation operators. The following uses `Resize` as an example: 2. Define data augmentation operators. The following uses `Resize` as an example:
```python ```python
...@@ -305,7 +305,6 @@ Figure 2: Image after its size is reset ...@@ -305,7 +305,6 @@ Figure 2: Image after its size is reset
```python ```python
import mindspore.dataset.transforms.vision.py_transforms as transforms import mindspore.dataset.transforms.vision.py_transforms as transforms
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib.image as mpimg
``` ```
2. Define data augmentation operators and use the `ComposeOp` API to combine multiple data augmentation operations. The following uses `RandomCrop` as an example: 2. Define data augmentation operators and use the `ComposeOp` API to combine multiple data augmentation operations. The following uses `RandomCrop` as an example:
```python ```python
......
...@@ -61,6 +61,7 @@ To read a dataset using the `MindDataset` object, perform the following steps: ...@@ -61,6 +61,7 @@ To read a dataset using the `MindDataset` object, perform the following steps:
1. Create `MindDataset` for reading data. 1. Create `MindDataset` for reading data.
```python ```python
import os
CV_FILE_NAME = os.path.join(MODULE_PATH, "./imagenet.mindrecord") CV_FILE_NAME = os.path.join(MODULE_PATH, "./imagenet.mindrecord")
data_set = ds.MindDataset(dataset_file=CV_FILE_NAME) data_set = ds.MindDataset(dataset_file=CV_FILE_NAME)
``` ```
......
...@@ -276,9 +276,9 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进 ...@@ -276,9 +276,9 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进
1. 将该模块引入进代码。 1. 将该模块引入进代码。
```python ```python
from mindspore.dataset.transforms.vision import Inter
import mindspore.dataset.transforms.vision.c_transforms as transforms import mindspore.dataset.transforms.vision.c_transforms as transforms
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib.image as mpimg
``` ```
2. 定义数据增强算子,以`Resize`为例: 2. 定义数据增强算子,以`Resize`为例:
```python ```python
...@@ -305,7 +305,6 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进 ...@@ -305,7 +305,6 @@ MindSpore提供`c_transforms`模块以及`py_transforms`模块函数供用户进
```python ```python
import mindspore.dataset.transforms.vision.py_transforms as transforms import mindspore.dataset.transforms.vision.py_transforms as transforms
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import matplotlib.image as mpimg
``` ```
2. 定义数据增强算子,通过`ComposeOp`接口将多个数据增强组合使用, 以`RandomCrop`为例: 2. 定义数据增强算子,通过`ComposeOp`接口将多个数据增强组合使用, 以`RandomCrop`为例:
```python ```python
......
...@@ -61,6 +61,7 @@ MindSpore天然支持读取MindSpore数据格式——`MindRecord`存储的数 ...@@ -61,6 +61,7 @@ MindSpore天然支持读取MindSpore数据格式——`MindRecord`存储的数
1. 创建`MindDataset`,用于读取数据。 1. 创建`MindDataset`,用于读取数据。
```python ```python
import os
CV_FILE_NAME = os.path.join(MODULE_PATH, "./imagenet.mindrecord") CV_FILE_NAME = os.path.join(MODULE_PATH, "./imagenet.mindrecord")
data_set = ds.MindDataset(dataset_file=CV_FILE_NAME) data_set = ds.MindDataset(dataset_file=CV_FILE_NAME)
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册