2024-04-26 22:43:14 发布
网友
我想给我的自动编码器添加初始化器
autoencoder=Model(input_img, decoded) autoencoder.add(Dense(64,kernel_initializer='random_uniform', bias_initializer='zeros'))
但我得到了这个错误
'Model' object has no attribute 'add'
如果要按顺序添加层(使用.add()方法),则需要使用这样的Sequential()模型:
.add()
Sequential()
autoencoder = Sequential() autoencoder.add(Dense(64,kernel_initializer='random_uniform', bias_initializer='zeros',input_shape=your_input_shape))
您可以通过阅读guide to Sequential model和{a2}找到更完整的解释。在
如果要按顺序添加层(使用
.add()
方法),则需要使用这样的Sequential()
模型:您可以通过阅读guide to Sequential model和{a2}找到更完整的解释。在
相关问题 更多 >
编程相关推荐