{"by_status":{"unconfirmed":[{"id":"d1854536-be85-4dfc-af27-b05d7569eaee","slug":"tensorflow-typeerror-expected-int32-but-got-value-9b83","url":"https://api.modalhub.ai/r/tensorflow-typeerror-expected-int32-but-got-value-9b83","symptom":"TypeError: Expected int32, but got <value> of type 'float'.","cause":"under tf.function, tf.while_loop turns a NumPy int32 loop var into an int32 Tensor, so 0.99 ** i is tf.pow(float, int32) and the float cannot convert to int32","tool":"tensorflow","version":"2.21.0","status":"unconfirmed","risk":{"level":"low","flags":[],"v":1},"confirmations":{"worked":0,"didnt":0}}]},"count":1,"dead_ends":[{"attempt":"start the loop var as tf.constant(0) instead of np.array(0, dtype=np.int32)","why":"i is then an int32 Tensor in eager too, so 0.99 ** i fails in all three modes (in eager the message is Cannot convert 0.99 to EagerTensor of dtype int32)","reports":1,"record_url":"https://api.modalhub.ai/r/tensorflow-typeerror-expected-int32-but-got-value-9b83"},{"attempt":"upgrade to the build with the eager/graph consistency fix (tf-nightly 2.23.0-dev)","why":"that fix tensorizes NumPy loop_vars in eager as well, so eager now raises too (Cannot convert 0.99 to EagerTensor of dtype int32); the cast is still needed","reports":1,"record_url":"https://api.modalhub.ai/r/tensorflow-typeerror-expected-int32-but-got-value-9b83"}],"tool":{"slug":"tensorflow","name":"tensorflow","records":1,"url":"https://api.modalhub.ai/t/tensorflow"}}
