TypeError: Input 'y' of 'Sub' Op has type int32 that does not match type float32 of argument 'x'.
I have done with building model but these some problem when training. The errors are not clear enough I have no idea about which causes these errors.
Epoch 1/5
/usr/local/lib/python3.7/dist-packages/tensorflow/python/autograph/impl/api.py:376: UserWarning: CRF decoding models have serialization issues in TF >=2.5 . Please see isse #2476
return py_builtins.overload_of(f)(*args)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-27-1b7e06547f26> in <module>()
1 history = MODEL.fit(X_tr, np.array(y_tr), batch_size=BATCH_SIZE, epochs=EPOCHS,
----> 2 validation_split=0.1, verbose=2)
9 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in wrapper(*args, **kwargs)
984 except Exception as e: # pylint:disable=broad-except
985 if hasattr(e, "ag_error_metadata"):
--> 986 raise e.ag_error_metadata.to_exception(e)
987 else:
988 raise
TypeError: in user code:
/usr/local/lib/python3.7/dist-packages/tensorflow/python/keras/engine/training.py:855 train_function *
return step_function(self, iterator)
/usr/local/lib/python3.7/dist-packages/keras/losses.py:142 __call__ *
losses = call_fn(y_true, y_pred)
<ipython-input-25-f9adc600d49b>:7 call *
mse = tf.math.reduce_mean(tf.square(y_true - y_pred))
/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/math_ops.py:1250 binary_op_wrapper
raise e
/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/math_ops.py:1234 binary_op_wrapper
return func(x, y, name=name)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/util/dispatch.py:206 wrapper
return target(*args, **kwargs)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/math_ops.py:548 subtract
return gen_math_ops.sub(x, y, name)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/ops/gen_math_ops.py:10562 sub
"Sub", x=x, y=y, name=name)
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/op_def_library.py:558 _apply_op_helper
inferred_from[input_arg.type_attr]))
TypeError: Input 'y' of 'Sub' Op has type int32 that does not match type float32 of argument 'x'.
Link to colab: https://colab.research.google.com/drive/1eRN8yxM4TyQ7JmO-hxjM76dIQz2_Hpga?usp=sharing
Link to dataset: https://drive.google.com/file/d/1cVRPolctpCgcQontLDm8OmNHUMBM1KSp/view?usp=sharing
Please help me with fixing this bug.