Created by: JepsonWong
error message enhancement for Conv2DTranspose.
- check the input's type is Variable
import paddle.fluid as fluid
from paddle.fluid.dygraph import nn
import numpy as np
images = np.ones([2, 3, 5, 5], dtype='float32')
conv2d = nn.Conv2DTranspose(
num_channels=3, num_filters=3, filter_size=[2, 2])
ret = conv2d(images)
TypeError: The type of 'input' in Conv2DTranspose must be <class 'paddle.fluid.framework.Variable'>, but received <type 'numpy.ndarray'>.
- check the input's dtype is in ['float16', 'float32', 'float64']
import paddle.fluid as fluid
from paddle.fluid.dygraph import nn
import numpy as np
images = fluid.layers.data(name='pixel', shape=[2, 3, 5, 5], dtype='int32')
conv2d = nn.Conv2DTranspose(
num_channels=3, num_filters=3, filter_size=[2, 2])
ret = conv2d(images)
TypeError: The data type of 'input' in Conv2DTranspose must be ['float16', 'float32', 'float64'], but received int32.