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

TYPE Error #10

Closed mohannadrateb closed 6 years ago

mohannadrateb commented 6 years ago

Hi! When trying to run conversation.py, this error pops up

TypeError: Value passed to parameter 'shape' has DataType float32 not in list of allowed values: int32, int64

so i checked the values of the shape parameter and i found that all the values passed was INT32 not float32. However i tried to modify the list of allowed values and append it to the list in the ops_def_library.py

def _SatisfiesTypeConstraint(dtype, attr_def, param_name): if attr_def.HasField("allowed_values"): allowed_list = attr_def.allowed_values.list.type allowed_list.append(DT_FLOAT32) if dtype not in allowed_list: raise TypeError( "Value passed to parameter '%s' has DataType %s not in list of " "allowed values: %s" % (param_name, dtypes.as_dtype(dtype).name, ", ".join(dtypes.as_dtype(x).name for x in allowed_list)))

after the modification when i try to run conversation.py this error pops up

File "/Users/Mohannad/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 56, in _SatisfiesTypeConstraint allowed_list.append(DT_FLOAT32) NameError: name 'DT_FLOAT32' is not defined

so any idea from where the value of shape float32 is passed instead of int 32 ? or how can i solve this problem ?

Finally thanks a lot !!

oswaldoludwig commented 6 years ago

I can see that you're using python3.6. These codes can run in Ubuntu 14.04.3 LTS, Python 2.7.6, Theano 0.9.0, and Keras 2.0.4. The use of another configuration may require some minor adaptations.