---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/op_def_library.py in apply_op(self, op_type_name, name, **keywords)
435 preferred_dtype=default_dtype,
--> 436 as_ref=input_arg.is_ref)
437 if input_arg.number_attr and len(
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py in internal_convert_n_to_tensor(values, dtype, name, as_ref, preferred_dtype)
764 as_ref=as_ref,
--> 765 preferred_dtype=preferred_dtype))
766 return ret
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py in internal_convert_to_tensor(value, dtype, name, as_ref, preferred_dtype)
703 if ret is None:
--> 704 ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
705
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/ops.py in _TensorTensorConversionFunction(t, dtype, name, as_ref)
576 "Tensor conversion requested dtype %s for Tensor with dtype %s: %r"
--> 577 % (dtype.name, t.dtype.name, str(t)))
578 return t
ValueError: Tensor conversion requested dtype float64 for Tensor with dtype float32: 'Tensor("rnn/BasicLSTMCellZeroState/zeros_1:0", shape=(?, 3), dtype=float32)'
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
<ipython-input-40-a1eb564e7b64> in <module>()
3 # ---------- Training -------------
4 print('---------- Training ------------')
----> 5 nn.fit(input_fn=get_train(), steps=10000)
6
7 # ---------- Evaluating -------------
/usr/local/lib/python3.4/dist-packages/tensorflow/python/util/deprecation.py in new_func(*args, **kwargs)
279 _call_location(), decorator_utils.get_qualified_name(func),
280 func.__module__, arg_name, date, instructions)
--> 281 return func(*args, **kwargs)
282 new_func.__doc__ = _add_deprecated_arg_notice_to_docstring(
283 func.__doc__, date, instructions)
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py in fit(self, x, y, input_fn, steps, batch_size, monitors, max_steps)
428 hooks.append(basic_session_run_hooks.StopAtStepHook(steps, max_steps))
429
--> 430 loss = self._train_model(input_fn=input_fn, hooks=hooks)
431 logging.info('Loss for final step: %s.', loss)
432 return self
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py in _train_model(self, input_fn, hooks)
925 features, labels = input_fn()
926 self._check_inputs(features, labels)
--> 927 model_fn_ops = self._get_train_ops(features, labels)
928 ops.add_to_collection(ops.GraphKeys.LOSSES, model_fn_ops.loss)
929 all_hooks.extend([
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py in _get_train_ops(self, features, labels)
1130 `ModelFnOps` object.
1131 """
-> 1132 return self._call_model_fn(features, labels, model_fn_lib.ModeKeys.TRAIN)
1133
1134 def _get_eval_ops(self, features, labels, metrics):
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py in _call_model_fn(self, features, labels, mode)
1101 if 'model_dir' in model_fn_args:
1102 kwargs['model_dir'] = self.model_dir
-> 1103 model_fn_results = self._model_fn(features, labels, **kwargs)
1104
1105 if isinstance(model_fn_results, model_fn_lib.ModelFnOps):
<ipython-input-8-d4e0b0fbefdf> in simple_rnn(features, targets, mode, params)
7 # 1. configure the RNN
8 lstm_cell = rnn.BasicLSTMCell(LSTM_SIZE, forget_bias=1.0)
----> 9 outputs, _ = rnn.static_rnn(lstm_cell, x, dtype=tf.float32)
10
11 # slice to keep only the last cell of the RNN
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py in static_rnn(cell, inputs, initial_state, dtype, sequence_length, scope)
195 state_size=cell.state_size)
196 else:
--> 197 (output, state) = call_cell()
198
199 outputs.append(output)
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py in <lambda>()
182 if time > 0: varscope.reuse_variables()
183 # pylint: disable=cell-var-from-loop
--> 184 call_cell = lambda: cell(input_, state)
185 # pylint: enable=cell-var-from-loop
186 if sequence_length is not None:
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py in __call__(self, inputs, state, scope)
239 else:
240 c, h = array_ops.split(value=state, num_or_size_splits=2, axis=1)
--> 241 concat = _linear([inputs, h], 4 * self._num_units, True)
242
243 # i = input_gate, j = new_input, f = forget_gate, o = output_gate
/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py in _linear(args, output_size, bias, bias_start)
1046 res = math_ops.matmul(args[0], weights)
1047 else:
-> 1048 res = math_ops.matmul(array_ops.concat(args, 1), weights)
1049 if not bias:
1050 return res
/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/array_ops.py in concat(values, axis, name)
1032 return gen_array_ops._concat_v2(values=values,
1033 axis=axis,
-> 1034 name=name)
1035
1036
/usr/local/lib/python3.4/dist-packages/tensorflow/python/ops/gen_array_ops.py in _concat_v2(values, axis, name)
517 """
518 result = _op_def_lib.apply_op("ConcatV2", values=values, axis=axis,
--> 519 name=name)
520 return result
521
/usr/local/lib/python3.4/dist-packages/tensorflow/python/framework/op_def_library.py in apply_op(self, op_type_name, name, **keywords)
462 (prefix, dtype.name))
463 else:
--> 464 raise TypeError("%s that don't all match." % prefix)
465 else:
466 raise TypeError("%s that are invalid." % prefix)
TypeError: Tensors in list passed to 'values' of 'ConcatV2' Op have types [float64, float32] that don't all match.