1

I develop my own op using eager execution. I met an error. How to fix it?

Env: Colaboratory TF ver.: 1.14

I use:

mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)

I tried tf.convert_to_tensor() but it led to other error. Error caused by:

loss_value, grads = grad(x_, y)

Error message:

    962     flat_sources = [_handle_or_self(x) for x in flat_sources]
    963     for t in flat_sources_raw:
--> 964       if not t.dtype.is_floating:
    965         logging.vlog(
    966             logging.WARN, "The dtype of the source tensor must be "

AttributeError: 'numpy.dtype' object has no attribute 'is_floating'

1 Answer 1

1

I got that reason of the error which indicates "if not is_floating" for the raising the exception.

To solve the error, it needs to make variable to a tensor, just using convert_to_tensor() before an operation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.