TypeError: DataType float32 para attr ‘Tindices’ no en la lista de valores permitidos: int32, int64

Estoy haciendo el curso CS224n de Stanford. Recibo un error en la asignación2 q2_parser_model.py en mi analizador de dependencias

== Initializing== Loading data... took 2.17 seconds Building parser... took 0.04 seconds Loading pretrained embeddings... took 2.16 seconds Vectorizing data... took 0.06 seconds Preprocessing training data... 1000/1000 [==============================] - 1s Building model... Traceback (most recent call last): File "q2_parser_model.py", line 286, in  main() File "q2_parser_model.py", line 252, in main model = ParserModel(config, embeddings) File "q2_parser_model.py", line 237, in __init__ self.build() File "/home/jarvis/My projects/Machine Learning/CS224n/My assignments/assignment2/model.py", line 109, in build self.pred = self.add_prediction_op() File "q2_parser_model.py", line 149, in add_prediction_op x = self.add_embedding() File "q2_parser_model.py", line 119, in add_embedding features = tf.nn.embedding_lookup(embedding, self.input_placeholder) File "/home/jarvis/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/embedding_ops.py", line 110, in embedding_lookup validate_indices=validate_indices) File "/home/jarvis/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_array_ops.py", line 1293, in gather validate_indices=validate_indices, name=name) File "/home/jarvis/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 582, in apply_op _Attr(op_def, input_arg.type_attr)) File "/home/jarvis/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 60, in _SatisfiesTypeConstraint ", ".join(dtypes.as_dtype(x).name for x in allowed_list))) TypeError: DataType float32 for attr 'Tindices' not in list of allowed values: int32, int64 

A continuación se muestra el fragmento de código y la línea donde obtengo el error.

 def add_embedding(self): embedding = tf.Variable(self.pretrained_embeddings, name = "embedding") --> features = tf.nn.embedding_lookup(embedding, self.input_placeholder) embeddings = tf.reshape(features, [-1, self.config.n_features * self.config.embedding_size]) ### END YOUR CODE return embeddings 

Su self.input_placeholder debe pasarse a tf.nn.embedding_lookup como una matriz de int32 o int64 , por lo que podría:

 features = tf.nn.embedding_lookup(embedding, np.asarray(self.input_placeholder, dtype=np.int32)) 

Me equivoqué, se debió a una definición de tipo de datos incorrecta. Definí un marcador de posición como float32 en lugar de int32

 self.labels_placeholder = tf.placeholder(tf.int32, shape=(self.config.batch_size, self.config.n_classes))