An-AI-Chatbot-in-Python-and-Flask icon indicating copy to clipboard operation
An-AI-Chatbot-in-Python-and-Flask copied to clipboard

Funcionamiento

Open MODoming opened this issue 1 year ago • 1 comments

Hola. Antes que nada, muchas gracias por el repositorio y el tutorial de internet, fue muy nutritivo. estoy tratando de ejecutarlo y no responde a nada de lo que le escriba, se queda esperando a que siga preguntando y no hace nada. por otro lado, te comento que tuve que hacerle modificaciones a las bibliotecas dado que esta desactualizado. en el archivo "train.py" reemplace "from tensorflow.keras.optimizers import SGD" por "import tensorflow as tf" teniendo que sustituir la linea "sgd = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)" por "sgd = tf.keras.optimizers.legacy.SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True)" no es necesario instalar "pip install tensorflow-gpu" dado que esta todo incluido en la nueva versión de "TensorFlow" Esto soluciono todos los problemas que tuve con el entrenamiento. Pero sigo sin obtener respuesta del chat creado. Escucha pero no responde, no se si no estoy haciendo algo mal y no encuentro que.

Muchas gracias por todo. Saludo desde Argentina.

MODoming avatar Jul 30 '23 17:07 MODoming

Hey,

I have also faced the same issue while running my code. Here is the updated code which I used to solve my error:

python --version: 3.11.5

Updated

(Removed decay, It seems like you're using a deprecated argument, decay, in the instantiation of the SGD optimizer from Keras. The decay argument has been deprecated in newer versions of Keras. To address this issue, you can switch to using the newer format for specifying learning rate schedules in the optimizer.)

sgd = SGD(learning_rate=0.01, momentum=0.9, nesterov=True)
model.compile(loss="categorical_crossentropy", optimizer=sgd, metrics=["accuracy"])

hope this will work for you!

Thanks from India! Let me know whether it worked or not.

Ramakm avatar Aug 27 '23 11:08 Ramakm