Tensorflow错误:dtype:'complex64'的变量密集_1 /内核的初始化程序

时间:2018-11-30 08:25:30

标签: tensorflow

当代码进入密集层时,出现以下错误->第二行(y_est = ...)

  

Tensorflow错误:dtype:'complex64'的变量density_1 / kernel的初始化程序是必需的

我的变量y_in具有复杂的值,看来我必须使用相同的变量类型(complex64)初始化密集层,但我不知道该怎么做。

有什么想法吗?

y_in = tf.reshape(input, shape=[-1,self.n])
y_est = tf.layers.dense(y_in, 20, activation= tf.nn.tanh) # line with error
h_hat = tf.layers.dense(y_est, 2, activation= None)

非常感谢您。

1 个答案:

答案 0 :(得分:1)

您尚未指定自己的自定义kernel_initializer,并且TensorFlow中的标准初始化程序尚不支持复杂的权重。有关详细信息和可能的解决方案,请参见this ticket