I am facing issue while generating noise in mnist dataset using GaussianNoise from tensorflow keras.
from tensorflow.keras.datasets import mnist
(X_train, y_train), (X_test, y_test) = mnist.load_data()
from tensorflow.keras.layers import GaussianNoise
sample = GaussianNoise(0.15)
sample(X_test[0:2],training=True )
TypeError: Exception encountered when calling layer "gaussian_noise_7" (type GaussianNoise).
Cannot convert 0.0 to EagerTensor of dtype uint8
Call arguments received: • inputs=tf.Tensor(shape=(2, 28, 28), dtype=uint8) • training=True
When I removed the training then error is eliminated but image is as such without any noise as function is inferring image as such without adding any noise.
Please help in sorting this issue.
Thanks !!!