我正在尝试遵循此suggestion。
outputs = Conv2DTranspose(3, (1, 1), activation='sigmoid') (c9)
model = Model(inputs=[inputs], outputs=[outputs])
model = multi_gpu_model(model, gpus=8)
model.compile(optimizer='adam', loss = bce, metrics = [mean_iou])
model.add(Lambda(lambda x: K.batch_flatten(x)))
但是在代码的最后一行,我收到以下错误:
“模型”对象没有属性“添加”
我知道,由于我没有像链接文章中那样将模型实例化为sequential()
,因此功能add()
可能对我不可用。但是,我不确定如何解决此问题。
答案 0 :(得分:1)
更正以反映出有效的解决方案:
outputs = Conv2DTranspose(3, (1, 1), activation='sigmoid') (c9)
outputs = Lambda(lambda x: K.batch_flatten(x))(outputs)
model = Model(inputs=[inputs], outputs=[outputs])
model = multi_gpu_model(model, gpus=8)
model.compile(optimizer='adam', loss = bce, metrics = [mean_iou])
答案 1 :(得分:0)
在OP的评论中忽略@Today的答案,
SELECT x.date
,x.website
,x.country_id
,x.product_id
,x.today_users
,SUM(x.today_users) OVER (PARTITION BY x.website, x.country_id, x.product_id
ORDER BY x.date ASC ROWS BETWEEN 7 PRECEDING AND 1 PRECEDING) AS Past_7D_Users
FROM (SELECT
date,
website,
country_id,
product_id,
SUM(user) AS today_users
FROM Table
GROUP BY
date, website, country_id, product_id
)x
GROUP BY x.date
,x.website
,x.country_id
,x.product_id
,x.today_users
;