Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

用paddle C-API做预测,更新模型出错 #4297

Closed
Jarlonyan opened this issue Sep 21, 2017 · 5 comments
Closed

用paddle C-API做预测,更新模型出错 #4297

Jarlonyan opened this issue Sep 21, 2017 · 5 comments
Labels
User 用于标记用户问题

Comments

@Jarlonyan
Copy link

在线预测中,加载模型A预测是OK的。现在需要用模型 B替换掉模型A,这个过程是热加载。也就是说在内存中同时有两份模型。现在的问题是:在A加载OK的情况下,再加载B,就爆出下面的错误,程序dump了。请问,这是什么原因呢?

F0921 16:30:03.393759  8187 utilities.cc:322] Check failed: !IsGoogleLoggingInitialized() You called InitGoogleLogging() twice!
*** Check failure stack trace: ***
    @     0x7f1f9170387d  google::LogMessage::Fail()
    @     0x7f1f9170732c  google::LogMessage::SendToLog()
    @     0x7f1f917033a3  google::LogMessage::Flush()
    @     0x7f1f9170883e  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f1f9170c3d3  google::glog_internal_namespace_::InitGoogleLoggingUtilities()
    @     0x7f1f9167aabc  paddle::initMain()
    @     0x7f1f9142fa77  paddle_init
    @           0x7bf722  DNNModel::init()
    @           0x7c08b2  DNNModel_reloader()
    @           0x6d98b4  wsy::HotLoader<>::reload()
    @           0x7ca8af  wsy::monitor_thread()
    @     0x7f1f932031c3  start_thread
    @     0x7f1f9074212d  __clone
    @              (nil)  (unknown)
Aborted (core dumped)
@luotao1
Copy link
Contributor

luotao1 commented Sep 21, 2017

请先按照 #3575 看下是否存在类似的问题

@lcy-seso lcy-seso added the User 用于标记用户问题 label Sep 21, 2017
@Jarlonyan
Copy link
Author

问题已经解决。谢谢了。

@luotao1
Copy link
Contributor

luotao1 commented Sep 21, 2017

@Jarlonyan 请问是如何解决的?能否comment一下,可以帮助以后的同学,谢谢

@Jarlonyan
Copy link
Author

我在主线程(线程A)中调用了一次paddle_init,然后主线程又启动了一个新的线程(线程B)用于加载新的模型。如果在线程B中也调用paddle_init,就会报错。我将paddle_init从类的构造函数中提取到进程开始,也就说一个进程只paddle_init一次就OK。

@luotao1
Copy link
Contributor

luotao1 commented Sep 21, 2017

非常感谢 @Jarlonyan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
User 用于标记用户问题
Projects
None yet
Development

No branches or pull requests

3 participants