service-streamer icon indicating copy to clipboard operation
service-streamer copied to clipboard

keras+flask+service_streamer发布服务出错:not an element of this graph

Open fushengwuyu opened this issue 6 years ago • 4 comments

如果不使用service_streamer,上诉问题只需要在预测的时候加上graph.as_default()即可解决,但是加上service_streamer又报该错误,我使用的是ThreadedStreamer,有什么办法解决该问题吗。

fushengwuyu avatar Nov 18 '19 02:11 fushengwuyu

请问能贴一下具体的报错信息吗,或者能不能给一个可以复现的方式,我们这边可以看下。

pku-wuwei avatar Nov 18 '19 12:11 pku-wuwei

我现在没电脑,明天把详细代码给你看看嘛,实在感谢你们。发自我的华为手机-------- 原始邮件 --------发件人: wuwei [email protected]日期: 2019年11月18日周一 20:23收件人: ShannonAI/service-streamer [email protected]抄送: fushengwuyu [email protected], Author [email protected]主 题: Re: [ShannonAI/service-streamer] keras+flask+service_streamer发布服务出错:not an element of this graph (#46)请问能贴一下具体的报错信息吗,或者能不能给一个可以复现的方式,我们这边可以看下。

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.

fushengwuyu avatar Nov 18 '19 13:11 fushengwuyu

你好,不好意思,我本以为我昨晚上回了邮件,现在才看到没发送。。。。

我的环境为:  python-3.6.5 keras-2.3.1 flask-1.1.1

原始代码太复杂,所以我简单用keras搭建了一个imdb情感分析模型,代码可复现。使用的是blueprint的方式搭建服务。 如果不加service_streamer, 则可以正常访问,但是加上的话,就报如下错误。该错误应该是算是keras+flask较为常见的错误,原本通过加上graph.as_default()即可解决,但是加上service_streamer之后,又报该错误了。。。。。

麻烦大神帮忙看看,谢谢了。

------------------ 原始邮件 ------------------ 发件人: "wuwei"<[email protected]>; 发送时间: 2019年11月18日(星期一) 晚上8:23 收件人: "ShannonAI/service-streamer"<[email protected]>; 抄送: "浮生物语"<[email protected]>;"Author"<[email protected]>; 主题: Re: [ShannonAI/service-streamer] keras+flask+service_streamer发布服务出错:not an element of this graph (#46)

请问能贴一下具体的报错信息吗,或者能不能给一个可以复现的方式,我们这边可以看下。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

fushengwuyu avatar Nov 19 '19 02:11 fushengwuyu

同样keras+flask+service_streamer也遇上相同的问题了,请问大神有合理的解决方式吗?拜谢

Hi-ylf avatar Jul 02 '21 02:07 Hi-ylf