My tensorflow implementation of "A neural conversational model", a Deep learning based chatbot

Overview

Deep Q&A

Join the chat at https://gitter.im/chatbot-pilots/DeepQA

Table of Contents

Presentation

This work tries to reproduce the results of A Neural Conversational Model (aka the Google chatbot). It uses a RNN (seq2seq model) for sentence predictions. It is done using python and TensorFlow.

The loading corpus part of the program is inspired by the Torch neuralconvo from macournoyer.

For now, DeepQA support the following dialog corpus:

To speedup the training, it's also possible to use pre-trained word embeddings (thanks to Eschnou). More info here.

Installation

The program requires the following dependencies (easy to install using pip: pip3 install -r requirements.txt):

  • python 3.5
  • tensorflow (tested with v1.0)
  • numpy
  • CUDA (for using GPU)
  • nltk (natural language toolkit for tokenized the sentences)
  • tqdm (for the nice progression bars)

You might also need to download additional data to make nltk work.

python3 -m nltk.downloader punkt

The Cornell dataset is already included. For the other datasets, look at the readme files into their respective folders (inside data/).

The web interface requires some additional packages:

  • django (tested with 1.10)
  • channels
  • Redis (see here)
  • asgi_redis (at least 1.0)

A Docker installation is also available. More detailed instructions here.

Running

Chatbot

To train the model, simply run main.py. Once trained, you can test the results with main.py --test (results generated in 'save/model/samples_predictions.txt') or main.py --test interactive (more fun).

Here are some flags which could be useful. For more help and options, use python main.py -h:

  • --modelTag <name>: allow to give a name to the current model to differentiate between them when testing/training.
  • --keepAll: use this flag when training if when testing, you want to see the predictions at different steps (it can be interesting to see the program changes its name and age as the training progress). Warning: It can quickly take a lot of storage space if you don't increase the --saveEvery option.
  • --filterVocab 20 or --vocabularySize 30000: Limit the vocabulary size to and optimize the performances and memory usage. Replace the words used less than 20 times by the <unknown> token and set a maximum vocabulary size.
  • --verbose: when testing, will print the sentences as they are computed.
  • --playDataset: show some dialogue samples from the dataset (can be use conjointly with --createDataset if this is the only action you want to perform).

To visualize the computational graph and the cost with TensorBoard, just run tensorboard --logdir save/.

By default, the network architecture is a standard encoder/decoder with two LSTM layers (hidden size of 256) and an embedding size for the vocabulary of 32. The network is trained using ADAM. The maximum sentence length is set to 10 words, but can be increased.

Web interface

Once trained, it's possible to chat with it using a more user friendly interface. The server will look at the model copied to save/model-server/model.ckpt. The first time you want to use it, you'll need to configure it with:

export CHATBOT_SECRET_KEY="my-secret-key"
cd chatbot_website/
python manage.py makemigrations
python manage.py migrate

Then, to launch the server locally, use the following commands:

cd chatbot_website/
redis-server &  # Launch Redis in background
python manage.py runserver

After launch, the interface should be available on http://localhost:8000/. If you want to deploy the program on a server, use python manage.py runserver 0.0.0.0 instead. More info here.

Chatbot web interface

Results

Surprisingly, it's possible to get some results after only 1 or 2 hours of training (on a GeForce GT 740M), by drastically reducing the input sequence to 5 words and output to 3 (plus the go and eos tokens) and by using a small embedding size (something like 25). Since then I modified the code and now the output length has to match the input one but you can still reproduce the original results, using this version. Of course, the network won't be really chatty:

Q: Hi
A: Hi.

Q: What is your name ?
A: Laura.

Q: What does that mean ?
A: I dunno.

Q: How old are you ?
A: thirty-five.

Q: Will Google hire me ?
A: No.

Q: Tell me the alphabet
A: Fuck you.

Q: That's not nice
A: Yeah.

Here is some case where it fails:

Q: Who is Laura ?
A: My brother.

Q: Say 'goodbye'
A: Alright.

Q: What is cooking ?
A: A channel.

Q: Can you say no ?
A: No.

Q: Two plus two
A: Manny...

With longer sentences, the network is much slower to train. After 250000 iterations with maxLength=10, the network still mainly gives evasive answers (by answering most of the open ended questions by 'I don't know') but it seems to have integrated some basic semantic:

Q: When are the fireworks ?
A: Tomorrow.

Q: What color ?
A: Gray.

Q: Which apple ?
A: That's the first one.

Q: What time is it ?
A: Eleven o'clock.

Q: Who is Skywalker ?
A: She's a freelance bio-exorcist.

Q: Who is John ?
A: The old man.

Q: Who is Jenny ?
A: The man who killed herself.

Q: When were you born ?
A: Soon.

As shown on the last questions, the network still does some confusion between the genders and the present/future. I also tried some deeper philosophical questions with more or less success.

Q: What is the purpose of being intelligent ?
A: The man are obsolete.

Q: What is immoral ?
A: The truth.

Q: What is morality ?
A: The worst.

Q: What is the purpose of existence ?
A: It 's private.

Q: What happens if machines can think ?
A: I think I'll just lie with you.

The model I trained is quite limited by the embedding size I put and by its size, and by the training corpus size. Its 'thought vector' is also probably too small to answer the kind of following:

Q: My name is David. What is my name ?
A: Debbie.

Q: My name is John. What is my name ?
A: Carl Smith.

Q: How many legs does a cat have ?
A: Four.

Q: How many legs does a spider have ?
A: Four.

Q: Do you prefer football or soccer ?
A: Whiskey.

It also seems to overfit as sometimes it will just pop out sentences from its training set unrelated to the question. Adding some dropout should reduce the issue.

Q: I play tennis. What do I play ?
A: I'm going to get laid.

Q: What color is the sky ?
A: One of the deputies is everywhere.

Pretrained model

You can find a pre-trained model here, trained of the default corpus. To use it:

  1. Extract the zip file inside DeepQA/save/
  2. Copy the preprocessed dataset from save/model-pretrainedv2/dataset-cornell-old-lenght10-filter0-vocabSize0.pkl to data/samples/.
  3. Run ./main.py --modelTag pretrainedv2 --test interactive.

Thanks to Nicholas C., here (original) are some additional pre-trained models (compatible with TF 1.2) for diverse datasets. The folder also contains the pre-processed dataset for Cornell, OpenSubtitles, Ubuntu and Scotus (to move inside data/samples/). Those are required is you don't want to process the datasets yourself.

If you have a high-end GPU, don't hesitate to play with the hyper-parameters/corpus to train a better model. From my experiments, it seems that the learning rate and dropout rate have the most impact on the results. Also if you want to share your models, don't hesitate to contact me and I'll add it here.

Improvements

In addition to trying larger/deeper model, there are a lot of small improvements which could be tested. Don't hesitate to send a pull request if you implement one of those. Here are some ideas:

  • For now, the predictions are deterministic (the network just take the most likely output) so when answering a question, the network will always gives the same answer. By adding a sampling mechanism, the network could give more diverse (and maybe more interesting) answers. The easiest way to do that is to sample the next predicted word from the SoftMax probability distribution. By combining that with the loop_function argument of tf.nn.seq2seq.rnn_decoder, it shouldn't be too difficult to add. After that, it should be possible to play with the SoftMax temperature to get more conservative or exotic predictions.
  • Adding attention could potentially improve the predictions, especially for longer sentences. It should be straightforward by replacing embedding_rnn_seq2seq by embedding_attention_seq2seq on model.py.
  • Having more data usually don't hurt. Training on a bigger corpus should be beneficial. Reddit comments dataset seems the biggest for now (and is too big for this program to support it). Another trick to artificially increase the dataset size when creating the corpus could be to split the sentences of each training sample (ex: from the sample Q:Sentence 1. Sentence 2. => A:Sentence X. Sentence Y. we could generate 3 new samples: Q:Sentence 1. Sentence 2. => A:Sentence X., Q:Sentence 2. => A:Sentence X. Sentence Y. and Q:Sentence 2. => A:Sentence X.. Warning: other combinations like Q:Sentence 1. => A:Sentence X. won't work because it would break the transition 2 => X which links the question to the answer)
  • The testing curve should really be monitored as done in my other music generation project. This would greatly help to see the impact of dropout on overfitting. For now it's just done empirically by manually checking the testing prediction at different training steps.
  • For now, the questions are independent from each other. To link questions together, a straightforward way would be to feed all previous questions and answer to the encoder before giving the answer. Some caching could be done on the final encoder stated to avoid recomputing it each time. To improve the accuracy, the network should be retrain on entire dialogues instead of just individual QA. Also when feeding the previous dialogue to the encoder, new tokens <Q> and <A> could be added so the encoder knows when the interlocutor is changing. I'm not sure though that the simple seq2seq model would be sufficient to capture long term dependencies between sentences. Adding a bucket system to group similar input lengths together could greatly improve training speed.
Comments
  • Continueing training doesn't seem to work

    Continueing training doesn't seem to work

    Everytime I continue with training I see a "globalStep" updated, but looking in Tensorboard it shows the loss like starting from scratch! It just seems like it starts over again:

    globStep: 5181 maxLength: 10 watsonMode: False hiddenSize: 256 numLayers: 2 embeddingSize: 32

    In the image below you can see I tried to continue training 2 times:

    tensorboard

    Any idea what is going wrong? I'm NOT passing the --reset flag.

    opened by kootenpv 11
  • Added support for initializing embeddings from pre-trained word vectors.

    Added support for initializing embeddings from pre-trained word vectors.

    The following patch enable to initialize embeddings with pre-trained word vectors. This is especially usefull when working with small datasets. In order to use this feature, just dowload the init vectors and place them in /data/word2vec then launch with --initEmbeddings.

    The difference can easily be seen by looking at the embeddings in tensorboard:

    • embedding_rnn_seq2seq/RNN/EmbeddingWrapper/embedding
    • embedding_rnn_seq2seq/embedding_rnn_decoder/embedding
    opened by eschnou 9
  • New ckpt format name with recent TF

    New ckpt format name with recent TF

    Description

    Train the model following the README, it takes two days to run for 30 epochs. After the program exit gracefully, it said -

    image

    In the save/ directory, I get image

    So these are the trained model.

    Then I copy save/model-201612031626 to save/model-server. As later chatbot_website would use this folder as default model. But it does not works. Running python manage.py runserver would clean the folder.

    Saving dataset...
    Loaded: 43462 words, 186544 QA
    Model creation...
    Initialize variables...
    WARNING: No previous model found, but some files found at /Users/hain/chatbot_butterfly/save/model-server. Cleaning...
    Removing /Users/hain/chatbot_butterfly/save/model-server/checkpoint
    Removing /Users/hain/chatbot_butterfly/save/model-server/events.out.tfevents.1480764302.dagama
    Removing /Users/hain/chatbot_butterfly/save/model-server/model.ckpt.data-00000-of-00001
    Removing /Users/hain/chatbot_butterfly/save/model-server/model.ckpt.index
    Removing /Users/hain/chatbot_butterfly/save/model-server/model.ckpt.meta
    Removing /Users/hain/chatbot_butterfly/save/model-server/params.ini
    Daemon mode, running in background...
    Initializing bot...
    

    So, I download the model-pretrained data from Google Drive.

    I copy the extracted data of model-pretrained into save/model-server. The app run successfully, and I can chat with bot from web interface, which is great.

    After comparing my model data and model-pretrained, it has different file names.

    save/model-201612031626

    checkpoint  
    events.out.tfevents.1480764302.dagama  
    model.ckpt.data-00000-of-00001  
    model.ckpt.index  
    model.ckpt.meta  
    params.ini
    

    model-pretrained

    model.ckpt  
    model.ckpt.meta  
    model_predictions.txt  
    params.ini
    

    So I guess model.ckpt.data-00000-of-00001 should be rename to model.ckpt. But it does not work, instead, python manage.py runserver said -

    W tensorflow/core/framework/op_kernel.cc:968] Data loss: Unable to open table file /Users/hain/chatbot_butterfly/save/model-server/mode
    l.ckpt: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:
     not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    W tensorflow/core/framework/op_kernel.cc:968] Data loss: Unable to open table file /Users/hain/chatbot_butterfly/save/model-server/mode
    l.ckpt: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    Initializing bot...
    Welcome to DeepQA v0.1 !
    
    TensorFlow detected: v0.11.0rc1
    Loading dataset from /Users/hain/chatbot_butterfly/data/samples/...
    Loaded: 35019 words, 139979 QA
    Model creation...
    Initialize variables...
    WARNING: Restoring previous model from /Users/hain/chatbot_butterfly/save/model-server/model.ckpt
    W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:
     not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:
     not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    W tensorflow/core/util/tensor_slice_reader.cc:95] Could not open /Users/hain/chatbot_butterfly/save/model-server/model.ckpt: Data loss:
     not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    W tensorflow/core/framework/op_kernel.cc:968] Data loss: Unable to open table file /Users/hain/chatbot_butterfly/save/model-server/mode
    l.ckpt: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
    

    So, how to get files in model-pretrained's format? Am I missing something?

    Environment

    Python - 3.5 TensorFlow - 0.11 rc1

    opened by hailiang-wang 9
  • Refactored sampled softmax

    Refactored sampled softmax

    The current sampled softmax implementation doesn't improve speed. This can be linked to this issue in Tensorflow seq2seq sample: https://github.com/tensorflow/tensorflow/issues/4138 which was fixed by this commit: https://github.com/tensorflow/tensorflow/pull/4270/commits/e5c81310ec2345cb9bd8f5c8ebb5e90724e0458c

    I've reproduced the fix on our codebase and could observe a major speedup when using sampled softmax:

    Hiddensize 1024

    • no sampled softmax 1.1s/it
    • sampledSoftmax=128 - 1.9s/it
    opened by eschnou 7
  • It gives me weird Answers

    It gives me weird Answers

    Hello, i trained the model also i used the pretrained model and I still get funny answers as describe what could be the cause. I'm running tensorflow 1.0 on a mac and Python 3.6

    ""Q: how are you A: Dunaway dunaway dunaway persona persona wingspan wingspan sagittarians sagittarians were— were— were—

    Q: what is morality A: Dunaway dunaway bug-wit bug-wit boccia boccia sagittarians sagittarians sagittarians sagittarians sagittarians melvins

    Q: I play tennis. What do I play? A: Voyeur voyeur voyeur voyeur telescopic telescopic telescopic telescopic telescopic telescopic telescopic tenses

    Q: hi A: Dunaway dunaway dunaway stooge please— please— grove grove grove 95 95 95""

    Q: how old are you? A: Dunaway disappearance fixin fixin fixin fixin fixin sagittarians sagittarians sagittarians sagittarians sagittarians

    Q: tell me the alphabet A: Dunaway dunaway disappearance disappearance disappearance disappearance disappearance disappearance disappearance philistine philistine philistine

    opened by paratata 6
  • About using a simple custom conversation format.

    About using a simple custom conversation format.

    As mentioned here [1], we can create our own simple conversation data between 2 people. I created a file called simple_chat.txt and placed it in DeepQA/data/lightweight directory with content:

    Hello
    Hi
    How are you?
    I am good. How are you?
    I am fine as well. How is the work?
    work is going on as usual. Thanks for asking.
    No problem.
    

    Now, when I run

     python3 main.py --corpus lightweight --datasetTag simple_chat --test interactive
    

    I do not see any answers from the bot. I get an output of something like:

    Q: Hello
    A:
    
    Q: How are you?
    A:
    

    Is it because my sample data is small? Or can someone explain if I am doing things correctly.

    [1] - https://github.com/Conchylicultor/DeepQA/tree/master/data/lightweight

    opened by shank7485 6
  • Softmaxsamples broken with move to 1.0

    Softmaxsamples broken with move to 1.0

    Using --softmaxSamples leads to the error below. I haven't investigated yet on root cause, but a lot of APIs have changed in 1.0.

    Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/common_shapes.py", line 670, in _call_cpp_shape_fn_impl status) File "/usr/lib/python3.4/contextlib.py", line 66, in exit next(self.gen) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/errors_impl.py", line 469, in raise_exception_on_not_ok_status pywrap_tensorflow.TF_GetCode(status)) tensorflow.python.framework.errors_impl.InvalidArgumentError: Shape must be rank 2 but is rank 1 for 'sequence_loss/sequence_loss_by_example/sampled_softmax_loss/LogUniformCandidateSampler' (op: 'LogUniformCandidateSampler') with input shapes: [?].

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last): File "main.py", line 29, in chatbot.main() File "/home/eschenal/Workspace/personal/DeepQA/chatbot/chatbot.py", line 166, in main self.model = Model(self.args, self.textData) File "/home/eschenal/Workspace/personal/DeepQA/chatbot/model.py", line 103, in init self.buildNetwork() File "/home/eschenal/Workspace/personal/DeepQA/chatbot/model.py", line 191, in buildNetwork softmax_loss_function= sampledSoftmax if outputProjection else None # If None, use default SoftMax File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1110, in sequence_loss softmax_loss_function=softmax_loss_function)) File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1067, in sequence_loss_by_example crossent = softmax_loss_function(target, logit) File "/home/eschenal/Workspace/personal/DeepQA/chatbot/model.py", line 138, in sampledSoftmax self.textData.getVocabularySize()), # The number of classes File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/nn_impl.py", line 1191, in sampled_softmax_loss name=name) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/nn_impl.py", line 947, in _compute_sampled_logits range_max=num_classes) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/candidate_sampling_ops.py", line 134, in log_uniform_candidate_sampler seed2=seed2, name=name) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/gen_candidate_sampling_ops.py", line 357, in _log_uniform_candidate_sampler name=name) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/op_def_library.py", line 763, in apply_op op_def=op_def) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 2397, in create_op set_shapes_for_outputs(ret) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 1757, in set_shapes_for_outputs shapes = shape_func(op) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py", line 1707, in call_with_requiring return call_cpp_shape_fn(op, require_shape_fn=True) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/common_shapes.py", line 610, in call_cpp_shape_fn debug_python_shape_fn, require_shape_fn) File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/common_shapes.py", line 675, in _call_cpp_shape_fn_impl raise ValueError(err.message) ValueError: Shape must be rank 2 but is rank 1 for 'sequence_loss/sequence_loss_by_example/sampled_softmax_loss/LogUniformCandidateSampler' (op: 'LogUniformCandidateSampler') with input shapes: [?].

    opened by eschnou 6
  • Chatbot responds to every question with

    Chatbot responds to every question with "I am a not . "

    Here are my results for "python main.py --test": **Q: Hi A: i 'm a not .

    Q: Hi! A: i 'm a not .

    Q: Are you conscious? A: i 'm a not .

    Q: How are you? A: i 'm a not .

    Q: What is your name ? A: i 'm a not .

    Q: Are you alive ? A: i 'm a not .

    Q: Luke, I am your father! A: i 'm a not .

    Q: You shall not pass! A: i 'm a not .

    Q: I'm going to kill you! A: i 'm a not .

    Q: Are you ready ? A: i 'm a not .

    Q: When are you ready ? A: i 'm a not .

    Q: What color is the sky? A: i 'm a not .

    Q: How old are you ? A: i 'm a not .

    Q: Can you say 'Hello' ? A: i 'm a not .

    Q: Can you say 'French fries' ? A: i 'm a not .

    Q: Can you say Hello ? A: i 'm a not .

    Q: Can you say French fries ? A: i 'm a not .

    Q: Can you say yes ? A: i 'm a not .

    Q: Can you say no ? A: i 'm a not .

    Q: Is this sentence false ? A: i 'm a not . **


    I didn't edit any of the source code-- I ran main.py for about an hour. It said in the docs that that time would give me some results. What am I doing wrong? I've tried this multiple times, and I still encounter this program after training it. I've restarted the program, and even re-downloaded the repo, so it's not a glitch in my code. I'm pretty sure that I installed the dependencies correctly. Any thoughts?

    opened by Higgins2718 6
  • [warning] initialize_all_variables is deprecated.

    [warning] initialize_all_variables is deprecated.

    Description

    Runing the current code against tensorflow 0.12.0-rc0.

    initialize_all_variables (from tensorflow.python.ops.variables) is deprecated.
    

    Solution

    I tensorflow/core/common_runtime/gpu/gpu_device.cc:916] 0:   Y                                                                                        [26/579]
    I tensorflow/core/common_runtime/gpu/gpu_device.cc:975] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GRID K520, pci bus id: 0000:00:03.0)
    
    WARNING:tensorflow:From /home/ubuntu/git/chatbot_butterfly/chatbot/chatbot.py:173 in main.: initialize_all_variables (from tensorflow.python.ops.
    variables) is deprecated and will be removed after 2017-03-02.
    Instructions for updating:
    Use `tf.global_variables_initializer` instead.
    Training:   0%|          | 3/4030 [00:00<22:14,  3.02it/s]I tensorflow/core/common_runtime/gpu/pool_allocator.cc:247] PoolAllocator: After 1768 get requests,
    put_count=1460 evicted_count=1000 eviction_rate=0.684932 and unsatisfied allocation rate=0.79638
    
    opened by hailiang-wang 6
  • Single word predicted

    Single word predicted

    Hi @Conchylicultor ,

    I was training the model for past one week and its global steps = 400k but still it is not able to predict more than one word. I used the movie corpus and few some wikipedia data to train the model.

    Please let me know how will model be able to predict a sentence?

    Regards, Rahul

    opened by goodrahstar 6
  • Using pre embedded vectors can I save the GPU memory taking for the process ?

    Using pre embedded vectors can I save the GPU memory taking for the process ?

    tf.contrib.legacy_seq2seq.embedding_rnn_seq2seq can embed each word in to desired dimensional vectors while the graph is running in a session. I don't have a clear idea on whether we can save the memory with using pre embedded word vectors.

    opened by shamanez 5
  • Error  import tensorflow as tf

    Error import tensorflow as tf

    line 26, in import tensorflow as tf from tensorflow_core import * from tensorflow.python.tools import module_util as _module_util

    Hi, I'm using python 3.6 and I have tried several tensorflow options but It's not work.

    ¿Can you help me please? ¿Do you know some combination os versions?

    Thank you!

    opened by NaterciaMR 0
  • how to change the cropus

    how to change the cropus

    firstly,i download OpenSubtitles corpus directly from here: http://opus.lingfil.uu.se/download.php?f=OpenSubtitles/en.tar.gz secondly i unpack the archive in\DeepQA-master\data\opensubs, lastly, i run main.py --corpus opensubs, but it show that "Loaded opensubs: 4 words, 0 QA" what is wrong with me?

    opened by hqlin2018 0
  • I want to change BasicLSTMCell to BasicRNNCell

    I want to change BasicLSTMCell to BasicRNNCell

    I want to change BasicLSTMCell to BasicRNNCell but it tell me NotFoundError (see above for traceback): Restoring from checkpoint failed. This is most likely due to a Variable name or other graph key that is missing from the checkpoint. Please ensure that you have not altered the graph expected based on the checkpoint. Original error:

    Key embedding_rnn_seq2seq/embedding_rnn_decoder/rnn_decoder/output_projection_wrapper/multi_rnn_cell/cell_0/basic_rnn_cell/bias not found in checkpoint [[node save/RestoreV2 (defined at D:\chen_ya\DeepQA_Fasttext_CBOW_RNNN\chatbot\chatbot.py:251) ]]

    opened by ChenYaChu 0
Owner
Conchylicultor
Research Engineer
Conchylicultor
Politecnico of Turin Thesis: "Implementation and Evaluation of an Educational Chatbot based on NLP Techniques"

THESIS_CAIRONE_FIORENTINO Politecnico of Turin Thesis: "Implementation and Evaluation of an Educational Chatbot based on NLP Techniques" GENERATE TOKE

cairone_fiorentino97 1 Dec 10, 2021
Deep Image Search is an AI-based image search engine that includes deep transfor learning features Extraction and tree-based vectorized search.

Deep Image Search - AI-Based Image Search Engine Deep Image Search is an AI-based image search engine that includes deep transfer learning features Ex

null 139 Jan 1, 2023
Deep Learning Package based on TensorFlow

White-Box-Layer is a Python module for deep learning built on top of TensorFlow and is distributed under the MIT license. The project was started in M

YeongHyeon Park 7 Dec 27, 2021
KSAI Lite is a deep learning inference framework of kingsoft, based on tensorflow lite

KSAI Lite is a deep learning inference framework of kingsoft, based on tensorflow lite

null 80 Dec 27, 2022
Realtime Face Anti Spoofing with Face Detector based on Deep Learning using Tensorflow/Keras and OpenCV

Realtime Face Anti-Spoofing Detection ?? Realtime Face Anti Spoofing Detection with Face Detector to detect real and fake faces Please star this repo

Prem Kumar 86 Aug 3, 2022
Curvlearn, a Tensorflow based non-Euclidean deep learning framework.

English | 简体中文 Why Non-Euclidean Geometry Considering these simple graph structures shown below. Nodes with same color has 2-hop distance whereas 1-ho

Alibaba 123 Dec 12, 2022
TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

TensorFlow Ranking is a library for Learning-to-Rank (LTR) techniques on the TensorFlow platform

null 2.6k Jan 4, 2023
Tensorflow 2 implementation of the paper: Learning and Evaluating Representations for Deep One-class Classification published at ICLR 2021

Deep Representation One-class Classification (DROC). This is not an officially supported Google product. Tensorflow 2 implementation of the paper: Lea

Google Research 137 Dec 23, 2022
Tensorflow implementation of Human-Level Control through Deep Reinforcement Learning

Human-Level Control through Deep Reinforcement Learning Tensorflow implementation of Human-Level Control through Deep Reinforcement Learning. This imp

Devsisters Corp. 2.4k Dec 26, 2022
TensorFlow implementation of "A Simple Baseline for Bayesian Uncertainty in Deep Learning"

TensorFlow implementation of "A Simple Baseline for Bayesian Uncertainty in Deep Learning"

YeongHyeon Park 7 Aug 28, 2022
Deep learning (neural network) based remote photoplethysmography: how to extract pulse signal from video using deep learning tools

Deep-rPPG: Camera-based pulse estimation using deep learning tools Deep learning (neural network) based remote photoplethysmography: how to extract pu

Terbe Dániel 138 Dec 17, 2022
A Marvelous ChatBot implement using PyTorch.

PyTorch Marvelous ChatBot [Update] it's 2019 now, previously model can not catch up state-of-art now. So we just move towards the future a transformer

JinTian 223 Oct 18, 2022
Deployment of PyTorch chatbot with Flask

Chatbot Deployment with Flask and JavaScript In this tutorial we deploy the chatbot I created in this tutorial with Flask and JavaScript. This gives 2

Patrick Loeber (Python Engineer) 107 Dec 29, 2022
Keqing Chatbot With Python

KeqingChatbot A public running instance can be found on telegram as @keqingchat_bot. Requirements Python 3.8 or higher. A bot token. Local Deploy git

Rikka-Chan 2 Jan 16, 2022
An efficient and effective learning to rank algorithm by mining information across ranking candidates. This repository contains the tensorflow implementation of SERank model. The code is developed based on TF-Ranking.

SERank An efficient and effective learning to rank algorithm by mining information across ranking candidates. This repository contains the tensorflow

Zhihu 44 Oct 20, 2022
Deploy tensorflow graphs for fast evaluation and export to tensorflow-less environments running numpy.

Deploy tensorflow graphs for fast evaluation and export to tensorflow-less environments running numpy. Now with tensorflow 1.0 support. Evaluation usa

Marcel R. 349 Aug 6, 2022
Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Peter Lin 6.5k Jan 4, 2023
Robust Video Matting in PyTorch, TensorFlow, TensorFlow.js, ONNX, CoreML!

Robust Video Matting (RVM) English | 中文 Official repository for the paper Robust High-Resolution Video Matting with Temporal Guidance. RVM is specific

flow-dev 2 Aug 21, 2022
Tensorflow Implementation of SMU: SMOOTH ACTIVATION FUNCTION FOR DEEP NETWORKS USING SMOOTHING MAXIMUM TECHNIQUE

SMU A Tensorflow Implementation of SMU: SMOOTH ACTIVATION FUNCTION FOR DEEP NETWORKS USING SMOOTHING MAXIMUM TECHNIQUE arXiv https://arxiv.org/abs/211

Fuhang 5 Jan 18, 2022