Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32. #54

Open
TessaJoseIgn opened this issue Apr 28, 2020 · 2 comments

Comments

@TessaJoseIgn
Copy link

Hi, I am getting the following error
TRAINING ROLO...
Traceback (most recent call last):
File "/home/###/threads/$$/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
preferred_dtype=default_dtype)
File "/home/###/threads/$$/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1146, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/home/###/threads/$$/venv/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 983, in _TensorTensorConversionFunction
(dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("Reshape:0", shape=(6, 4102), dtype=float32)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "experiments/training/ROLO_step6_train_20_exp1.py", line 332, in
main(' ')
File "experiments/training/ROLO_step6_train_20_exp1.py", line 329, in main
ROLO_TF(argvs)
File "experiments/training/ROLO_step6_train_20_exp1.py", line 95, in init
self.ROLO(argvs)
File "experiments/training/ROLO_step6_train_20_exp1.py", line 325, in ROLO
self.train_20()
File "experiments/training/ROLO_step6_train_20_exp1.py", line 222, in train_20
self.build_networks()
File "experiments/training/ROLO_step6_train_20_exp1.py", line 134, in build_networks
self.lstm_module = self.LSTM_single('lstm_test', self.x, self.istate, self.weights, self.biases)
File "experiments/training/ROLO_step6_train_20_exp1.py", line 105, in LSTM_single
_X = tf.split(0, self.num_steps, _X) # n_steps * (batch_size, num_input)
File "/home/###/threads/$$/venv/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1327, in split
axis=axis, num_split=num_or_size_splits, value=value, name=name)
File "/home/###/threads/$$/venv/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 8083, in split
"Split", split_dim=axis, value=value, num_split=num_split, name=name)
File "/home/###/threads/$$/venv/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 533, in _apply_op_helper
(prefix, dtypes.as_dtype(input_arg.type).name))
TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32.

@Niveditakatta
Copy link

Refer to this: tensorflow/tensorflow#6501

@abbasturkoglu
Copy link

Change this part:
_X = tf.split(0, self.num_steps, _X)

to this:
_X = tf.split(_X, self.num_steps, 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants