AbrahamSanders / seq2seq-chatbot

A sequence2sequence chatbot implementation with TensorFlow.
MIT License
99 stars 56 forks source link

tf.contrib.learn.ModeKeys.validate(self.mode) AttributeError: type object 'ModeKeys' has no attribute 'validate' #35

Closed NitinSaini18 closed 3 years ago

NitinSaini18 commented 3 years ago

Hi, I am trying to run your model in system from the references of Kirill Eremenko & Hadelin de Ponteves Deep NLP Udemy course I am facing this error : Traceback (most recent call last): File "chat.py", line 43, in model_dir = model_dir) as model: File "C:\Users\Lenovo\Documents\seq2seq-chatbot\seq2seq-chatbot\chatbot_model.py", line 71, in init tf.contrib.learn.ModeKeys.validate(self.mode) AttributeError: type object 'ModeKeys' has no attribute 'validate'

my tensorflow version is also same as mentioned. tf.version Out[2]: '1.0.0' could you please suggest some way how to solve it.

AbrahamSanders commented 3 years ago

This is a different model from the one Hadelin coded in the course. His uses TF 1.0, this one uses TF 1.5+ or higher.

NitinSaini18 commented 3 years ago

Thank you so much it is solve now.

On Fri, 18 Sep 2020 05:37 Avi Sanders, notifications@github.com wrote:

This is a different model from the one Hadelin coded in the course. His uses TF 1.0, this one uses TF 1.5+ or higher.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AbrahamSanders/seq2seq-chatbot/issues/35#issuecomment-694565969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMV6ZXQAMKODHQYVZD2FUE3SGKQCTANCNFSM4RP3TUDQ .

NitinSaini18 commented 3 years ago

Hi sir, I am making one website related to travel & tourism using Django and I want to add a chatbot to my website. and when I google it shows me lots of chatbot making websites. I don't want to use those websites. I have made one of my own chatbot using PyTorch. What I want to know from you is how can I add my own trained chatbot to my website.

AbrahamSanders commented 3 years ago

You would need to host your bot as an API and call it from your website code. There are many ways to do that and the best approach really depends on the platform you are using to develop your website. At the most basic level you could use something like Flask and Flask-RESTful to create an API that serves your model.