在这个卷积层出错:
错误信息:
TypeError: Value passed to parameter ‘paddings’ has DataType float32 not in list of allowed values: int32, int64
解决方法:
import numpy as np
x_padded = tf.pad(x, [[0, 0], [np.int(kernel / 2), np.int(kernel / 2)], [np.int(kernel / 2), np.int(kernel / 2)], [0, 0]], mode=mode)
原因:可能是tensorFlow版本不同,新版本的tf对数据格式要求更为严格。