我正在尝试将MNIST数据集转换为RGB。我使用以下代码执行此操作,但出现错误,它可与tensorflow1.12.0一起使用,但不适用于tensorflow1.14.0(我的项目基于tensorflow1.14.0)。
Private Sub Class_Initialize()
Set subjectData = New Scripting.Dictionary
With subjectData
.Add "name", ""
.Add "inn", ""
.Add "ogrn", ""
.Add "address", ""
End With
End Sub
我得到的错误:
mnist = tf.keras.datasets.mnist
(x_train, _), (x_test, _) = mnist.load_data()
X = np.concatenate([x_train, x_test])
X = X.reshape((70000, 28, 28, 1))
assert X.shape == (70000, 28, 28, 1)
X = tf.image.grayscale_to_rgb(X, name=None)
assert X.shape == (70000, 28, 28, 3)