Why am I getting this error?
In one of the Dense layers I want to specify the HE Uniform weight initializer, like so:
Dense(64, input_shape=input_shape, kernel_initializer=tf.keras.initializers.he_uniform())
And I get an error:
ValueError: Could not interpret initializer identifier: 0
When instead I specify it differently , like this:
kernel_initializer=tf.keras.initializers.HeUniform()
I get a different error:
module 'tensorflow_core.keras.initializers' has no attribute 'HeUniform'
I am using the following imports:
import tensorflow as tf
import tensorflow.keras as keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
What is wrong? And btw what is the difference between HeUniform()
and he_uniform()
?
Thanks
HeUniform()
andhe_uniform()
are the same. I tried to reproduce your error but it worked fine for me. What is the value of theinput_shape
parameter? – Sherlinput_shape
istrain_data[0].shape
which in my case is(4,)
– Smokejumpertf.__version__
) – Selfimprovement