DeepQA icon indicating copy to clipboard operation
DeepQA copied to clipboard

reuse error when I tries to do another round prediction in daemon mode

Open AkishinoShiame opened this issue 7 years ago • 2 comments

In my structure I use flask server, and using "from chatbot import chatbot" to include the chatbot then I initial as below to perform predict

    AkishinoProjectBot = chatbot.Chatbot()
    AkishinoProjectBot.main(['--modelTag', 'taiwa20170709', '--test', 'daemon'])
    # --modelTag    taiwa20170709
    # --test        daemon
    answer = AkishinoProjectBot.daemonPredict(sentence=sentence_in)
    AkishinoProjectBot.daemonClose()
    del AkishinoProjectBot
    return answer

everything got well in my first round, but only works in the first. While I try after first round always got the error below.

ValueError: Variable embedding_rnn_seq2seq/rnn/embedding_wrapper/embedding already exists, disallowed. Did you mean to set reuse=True in VarScope?

Is there any solution can fixed this issue? Thanks. By the way I've also tries to fix it with reuse=None but did'n get anything works.

image

AkishinoShiame avatar Jul 24 '17 03:07 AkishinoShiame

Try using "from main import chatbot" instead of "from chatbot import chatbot", this fixed the issue for me.

nichcuta avatar Oct 16 '17 14:10 nichcuta

Much of Thanks, @nichcuta ! It works!!!

AkishinoShiame avatar Oct 17 '17 15:10 AkishinoShiame