TypeError: Value passed to parameter ‘shape’ has DataType float32 not in list of allowed values: int32, int64
我解决了
dense keras跑程序错误
源代码
...
interNo = n_x/4
...
...
temp_h_q = Dense(interNo, activation='relu')(input
报错
TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64
解决 输入dense的必须int32 int64
interNo = n_x//4
...
temp_h_q = Dense(interNo, activation='relu')(input)
开心开心 卡了一上午
另附其他解决方法:
data = tf.cast(data, tf.float32)
// 或者
data = tf.cast(data, tf.int32)
// 还有其他的解决是
int(data)
其他的解决可能不适用于tf keras 很显然有的需要tensor