无法将类型<class'tensorlayer.layers.prelulayer'=“”>的对象转换为Tensor。考虑将元素强制转换为受支持的类型

时间:2019-01-28 12:04:37

标签: python-3.x tensorflow

我正在使用Tensorflow构建CNN模型。但是,使用tf.image.resize_images函数时出现两个错误:

第一个错误,

TypeError: Expected binary or unicode string, got <tensorlayer.layers.PReluLayer object at 0x0000000031962D68>

第二个错误

TypeError: Failed to convert object of type <class 'tensorlayer.layers.PReluLayer'> to Tensor. Contents:   Last layer is: PReluLayer. Consider casting elements to a supported type.

我的代码的一部分是

#########################################################
conv4 = Conv2d(conv3_bn_relu_pool, 256, (3, 3), (1, 1), act=None, padding='SAME', W_init=w_init, name='conv4')
conv4_bn = BatchNormLayer(conv4, act=tf.identity, is_train=is_train, gamma_init=g_init, name='conv4_bn')
conv4_bn_relu = PReluLayer(conv4_bn, name='conv4_bn_relu')    

################################Deconvolution (up-sample + Conv)#########################
deconv1_upsample = tf.image.resize_images(conv4_bn_relu, size=[64,64], method=tf.image.ResizeMethod.BILINEAR)

0 个答案:

没有答案