CaptchaSolver icon indicating copy to clipboard operation
CaptchaSolver copied to clipboard

Error: Op has type float32 that does not match expected type of int32.

Open robertozoia opened this issue 7 years ago • 2 comments

I'm getting the following error when running $ python all_digits.py, just after the extraction of the test images has begun:

(...)
9000
Extract test images
500

Traceback (most recent call last):
  File "/Users/robertoz/dev/venvs/captcha-cracking/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
    preferred_dtype=default_dtype)
  File "/Users/robertoz/dev/venvs/captcha-cracking/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1107, in internal_convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/Users/robertoz/dev/venvs/captcha-cracking/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 944, in _TensorTensorConversionFunction
    (dtype.name, t.dtype.name, str(t)))
ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("Add_3:0", shape=(?, 54), dtype=float32)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "all_digits.py", line 86, in <module>
    pred_digits = tf.split(1, 6, pred)
  File "/Users/robertoz/dev/venvs/captcha-cracking/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 1315, in split
    axis=axis, num_split=num_or_size_splits, value=value, name=name)
  File "/Users/robertoz/dev/venvs/captcha-cracking/lib/python3.6/site-packages/tensorflow/python/ops/gen_array_ops.py", line 7793, in split
    "Split", split_dim=axis, value=value, num_split=num_split, name=name)
  File "/Users/robertoz/dev/venvs/captcha-cracking/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.

I'm using Python 3.6 on MacOS, tensorflow version 1.9

robertozoia avatar Jul 17 '18 22:07 robertozoia

I have sidestepped this issue by using an old version of tensorflow (0.12.1).

pip install tensorflow==0.12.1

robertozoia avatar Aug 13 '18 15:08 robertozoia

Same Error. TypeError: Input 'split_dim' of 'Split' Op has type float32 that does not match expected type of int32. With

I have sidestepped this issue by using an old version of tensorflow (0.12.1).

pip install tensorflow==0.12.1

Is it working the whole code with this version ?

Georgitanev avatar Sep 18 '18 14:09 Georgitanev