From 1713ab555573bc9f38947c0a700de79fb0be4ba1 Mon Sep 17 00:00:00 2001 From: TerminalMan <84923604+SecretiveShell@users.noreply.github.com> Date: Thu, 23 Sep 2021 10:46:31 +0100 Subject: [PATCH] Update chatbot.py I was having issues importing SGD and the changed import statement fixed that, so I added it as an automatic check. https://stackoverflow.com/a/68199964/9670840 --- python-deep-learning-chatbot/chatbot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python-deep-learning-chatbot/chatbot.py b/python-deep-learning-chatbot/chatbot.py index a22bf66..f672262 100644 --- a/python-deep-learning-chatbot/chatbot.py +++ b/python-deep-learning-chatbot/chatbot.py @@ -9,7 +9,13 @@ import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation, Dropout -from keras.optimizers import SGD + +# error importing SGD directly on windows +try : + from keras.optimizers import SGD +except : + from tensorflow.keras.optimizers import SGD + import random words=[]