oswaldoludwig / Seq2seq-Chatbot-for-Keras

This repository contains a new generative model of chatbot based on seq2seq modeling.
Apache License 2.0
331 stars 98 forks source link

ValueError: 'the context text' is not a valid scope name, running conversation_discriminator.py #12

Closed lk251 closed 6 years ago

lk251 commented 6 years ago

Error when running conversation_discriminator.py Using Tensorflow 1.4.1, keras 2.0.4

$ python conversation_discriminator.py Using TensorFlow backend. Starting the model... Traceback (most recent call last): File "conversation_discriminator.py", line 223, in input_context = Input(shape=(maxlen_input,), dtype='int32', name='the context text') File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/keras/engine/topology.py", line 1414, in Input
input_tensor=tensor) File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/keras/legacy/interfaces.py", line 88, in wrapper
return func(*args, **kwargs) File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/keras/engine/topology.py", line 1325, in init
name=self.name) File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/keras/backend/tensorflow_backend.py", line 391, in placeholder
x = tf.placeholder(dtype, shape=shape, name=name) File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/tensorflow/python/ops/array_ops.py", line 1599, in placeholder
return gen_array_ops._placeholder(dtype=dtype, shape=shape, name=name) File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/tensorflow/python/ops/gen_array_ops.py", line 3091, in _placeholder
"Placeholder", dtype=dtype, shape=shape, name=name) File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/tensorflow/python/framework/op_def_library.py", line 394, in _apply_op_helper with g.as_default(), ops.name_scope(name) as scope: File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/tensorflow/python/framework/ops.py", line 4932, in enter
return self._name_scope.enter() File "/usr/lib/python2.7/contextlib.py", line 17, in enter return self.gen.next() File "/home/javier/repos/dialogue/Seq2seq-Chatbot-for-Keras/venv/local/lib/python2.7/sit e-packages/tensorflow/python/framework/ops.py", line 3519, in name_scope
raise ValueError("'%s' is not a valid scope name" % name) ValueError: 'the context text' is not a valid scope name

oswaldoludwig commented 6 years ago

This project uses Theano as Backend.

oswaldoludwig commented 6 years ago

These links can help you: https://stackoverflow.com/questions/42177658/how-to-switch-backend-with-keras-from-tensorflow-to-theano and https://github.com/keras-team/keras/issues/5374

muhammedmokbel commented 4 years ago

i am facing same problem and i can't handle it I am working on colab so I can't understand how to change the backend to theano ?