-
Notifications
You must be signed in to change notification settings - Fork 643
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
AttributeError: 'float' object has no attribute 'astype' #2096
Comments
@ChinChangYang can you further explain the same with your code?? |
The code that generates the debug log is here: ChinChangYang@baac89b Basically, I printed the input object of the In this case, the input object
Then, I traced the
In the above log, the input object of the
The input object of the
This is the final node that I traced to debug. In
Then, I saw I am not saying converting a Tensor to a Scalar is a logical bug, but when I try to write a minimum code to reproduce this issue, it is not easy to me to generate a Scalar input. Somehow, the input object is always Tensor in my test code. |
Okay I got your thought on it. Let me work out on the stuff and get back to you |
Fixed by #2087. |
🐞Describing the bug
When converting a TensorFlow keras model into a mlprogram, it fails with the an attribute error.
In the pull request LeelaChessZero/lczero-training#222, Test 2: 512x19 (FAILED) shows the full log.
Stack Trace
To Reproduce
Not available.
System environment (please complete the following information):
Additional context
Related to this pull request: #2087
Similar issue: #1768
Debug log
I added some log to trace how the
float
object was created and saw this:The
float
object comes frommodel/tf.math.sqrt/Sqrt
, which comes from the output ofmodel/tf.cast/Cast
, which comes from the output ofmodel/tf.__operators__.getitem/strided_slice
, which comes from this:Finally, I could see
x
was a Tensor, and thesex
,begin
,end
, andstride
variables were input parameters of the following function call:The output
x
became a scalar from now on.The text was updated successfully, but these errors were encountered: