Training a Model – Creating a Chatbot with Deep Learning, Python, and TensorFlow p.7




[ad_1]

Welcome to part 7 of the chatbot with Python and TensorFlow tutorial series.

Paperspace GPUs in the cloud $10 referral link: https://goo.gl/sY3M7Y

NMT Chatbot Project Github: https://github.com/daniel-kukiela/nmt-chatbot

Here, we’re going to discuss our model. There are endless models that you could come up with and use, or find online and adapt to your needs. My main interest was in sequence to sequence models, since sequence to sequence models can be used for a chatbot, sure, but can also be used for a whole host of other things too. Basically everything in life can be reduced to sequences being mapped to sequences, so we could train quite a bit of things. For now though: I want a chatbot.

Text tutorials and sample code: https://pythonprogramming.net/
https://pythonprogramming.net/support-donate/
https://twitter.com/sentdex
https://www.facebook.com/pythonprogramming.net/
https://www.twitch.tv/sentdex
https://plus.google.com/+sentdex

Source


[ad_2]

Comment List

  • sentdex
    December 2, 2020

    Hey sentdex,
    Instead of still sticking with tensorflow 1.4, it would be great if you could update the code to run in tensorflow 2.0 since it doesn't have hparams.
    And the tensorflow version 1.4 is no longer downloadable.

  • sentdex
    December 2, 2020

    Shows error while running train.py —- from tensorflow.python.ops import lookup_ops
    ImportError: cannot import name 'lookup_ops'

  • sentdex
    December 2, 2020

    I've been following this dude's tutorials forever. They're always quick/easy to follow, concise, and he never over-explains or under-explains anything.

  • sentdex
    December 2, 2020

    sorry i'm really late on this, but i would love to hear from you,
    do you need to download CUDA / CUDNN to make it work if you are using ubuntu ML in a box?
    thank you so so so much

  • sentdex
    December 2, 2020

    is paperchase required or could a local version be done? Or…would this be horrific if the computer isn't fast enough..? sorry, new to all of this man. i know this was briefly explained in the video

  • sentdex
    December 2, 2020

    hey man, first of all: very nice video! But i got a few questions:
    1. I have a model training with around 11.6 million pairs, it's on step 65.000 now (first epoch) and the ppl score is around 90 since the last 20k steps and it doesn't seem to go down for now,while the eval dev and eval test say it is around 50, is that normal? and if not, how to fix it? (everything standart but vocab size = 60.000 and epochs = 0.001, 0.001, 0.0001, 0.00001
    2. I got 5240 lines of test, but it takes only the first 100 lines for testing the model, i once changed 'test-size' in settings.py to 5240, but that caused the model to rush through the epochs without really training (finished epochs instant). any idea how to tell the model to use all lines for testing?
    thanks

  • sentdex
    December 2, 2020

    was this made for tensorflow 1.4?

  • sentdex
    December 2, 2020

    Working on Windows 10 as of April 2020. I am using an Nvidia GPU. Here is what I did.

    Install Python 3.6.5 and pip.

    Install CUDA 8.0 from CUDA toolkit archive.

    Install cuDNN v6.0 for CUDA 8.0 from cuDNN archive.

    Install tensorflow 1.4.0 with this command, pip install tensorflow-gpu==1.4.0

    When you clone his branch, make sure you clone the version featured in the video.

    Hopefully this helps someone.

  • sentdex
    December 2, 2020

    Hi Harrison thanks for your awesome videos 😊. Can you please tell which CPU and memory option you chose when you trained it on DigitalOcean? And how much time did it take approx??

  • sentdex
    December 2, 2020

    After the line Init train iterator, skipping 0 elements my system freezes and I have to forcefully make it shutdown. Also before this line, it says Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX AVX2 FMA.
    Plz, help me regarding this issue.

  • sentdex
    December 2, 2020

    wow this was boring, i was expecting you to show us how to actually build the chatbot program too instead of just copying some code from github, the series was very good up until now.

  • sentdex
    December 2, 2020

    I get this error when i run "python prepare-data.py"

    ModuleNotFoundError: No module named 'regex'

  • sentdex
    December 2, 2020

    How to run the python train.py with tensorflow 2.0.1????? Please help.

  • sentdex
    December 2, 2020

    Import Error: cannot import name 'nmt' any help please

  • sentdex
    December 2, 2020

    if I'm following along now do I need to install CUDA?

  • sentdex
    December 2, 2020

    how long will training take?

  • sentdex
    December 2, 2020

    dude I am so going to put your name in my student acknowledgment for my final year submission as a token of thanks

  • sentdex
    December 2, 2020

    paperspace is not working!! Help please T_T The choose machine option is all locked up..

  • sentdex
    December 2, 2020

    How many steps does it take??

  • sentdex
    December 2, 2020

    Hi,
    I got some unicode mixture in the output "â– – who â– would â– win â– in â– a â– fight , â– le b ron â– j ames , â– or"
    Here hi-fan are showing as some unicode characters in my screen. But here appear it as dash along with a^.

    how to come out from this problem???

  • sentdex
    December 2, 2020

    DOES THIS WORK ON TENSORFLOW 2.0???

    (Sorry for the caps but rlly need this answered…)

  • sentdex
    December 2, 2020

    Instead of using paper space, you could use Google colabratory. It runs entirely on the cloud and allows you to accelerate GPU.

  • sentdex
    December 2, 2020

    What is

    python-Levenshtein
    for? I cannot get it to install after about 8 hours of changes to installation/reinstallation
    .

  • sentdex
    December 2, 2020

    train.py is throwing this error

    File "train.py", line 25 in train
    with open('{}/corpus_size'.format(preprocessing['train_folder']), 'r') as f:
    FileNotFoundError: [Errno 2] No Such file or directory: 'data//corpus_size'

    idk what file is missing

  • sentdex
    December 2, 2020

    Preparing training set from raw set
    File: train.from
    Traceback (most recent call last):
    File "prepare_data.py", line 563, in <module>
    prepare()
    File "prepare_data.py", line 79, in prepare
    number_of_records = min(amount, sum(1 for _ in open_function(source_file_name, 'rt', encoding='utf-8', **additioan_params)))
    UnboundLocalError: local variable 'open_function' referenced before assignment

    getting this error while running prepare_data.py

    python version 3.6.8

  • sentdex
    December 2, 2020

    Hello, I got this problem: OSError: [WinError 193] %1 is not a valid Win32 application when i was trying to execute train.py...
    Any helps? Thanks alots!!!

  • sentdex
    December 2, 2020

    Is there a way for me to make the chatbot understand context?

  • sentdex
    December 2, 2020

    Is there an alternative to training it on paperspace? I'm having issues with using it and for the meanwhile I'm training it on my computer. However, this is taking a long time.

  • sentdex
    December 2, 2020

    When using my own data, how do I generate the tst2012 and tst2013 files? The previous video only covered the train and test files.

  • sentdex
    December 2, 2020

    I am getting errors while installing tensorflow-gpu>=1.4.0 and python-Levenshtein.
    Please Help @sentdex

  • sentdex
    December 2, 2020

    here 2015-05 file have data in parent but in mine 2015-05 is null can any body tell which year file is correct

  • sentdex
    December 2, 2020

    i don't no about deep learning. To do this Chat not, what shoud i learn first?

  • sentdex
    December 2, 2020

    can i use this on cpu?

  • sentdex
    December 2, 2020

    For those who wonder why train.py raise an error for Tensorflow 1.14, it's because in nmt-chatbotnmtnmtutilsmisc_utils.py, it checks if your tensorflow version is recent enough with :

    def check_tensorflow_version():
    min_tf_version = "1.4.0"
    if tf._version_ < min_tf_version:
    raise EnvironmentError("Tensorflow version must >= %s" % min_tf_version)

    And Python considers 1.14 < 1.4 == True …

    So either change check_tensorflow_version or install tf 1.4 – 1.9 ^^

  • sentdex
    December 2, 2020

    Now I'll have to eliminate everything i've done cuz from this video I didn't get a s… I didn't know what you were doing with tensorflow and that paperspace. 2 days of doing this for nothing ¬¬

  • sentdex
    December 2, 2020

    SyntaxError: Non-ASCII character 'xe2' in file prepare_data.py on line 512, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

    Help

  • sentdex
    December 2, 2020

    Can I have your paperspace computer specs please Harris
    You’re tutorials are great btw

  • sentdex
    December 2, 2020

    2019-04-03 14:48:46.636577: W tensorflow/core/framework/allocator.cc:124] Allocation of 1305678336 exceeds 10% of system memory.

    ERROR occur during execute train.py

Write a comment