Open cansik opened 2 years ago
Looks like the dimension of the input is not an integer. Is input int self._localizer.predict(input) a numpy array (it should be)?
Yes it is a numpy array, but as float32
(shape = (297, 528, 3)
). I did not change anything in the code, but it seems that your self._make_input
already changes it to float32
.
To be honest, I do not really understand what is going on at that part of the code: predict.py#L206-L216 It seems that you change the model to include more outputs. Could you explain me please why you are recreating the model so I am able to investigate a bit further?
I now split up the call here to see where the error really happens:
cast = tf.cast(local_max_idx[:, 2:], np.float32)
gather = tf.gather_nd(average_pos, local_max_idx)
yx = gather + cast
The tf.cast
is throwing the exception. local_max_idx[:, 2:]
has a shape of (None, 2)
which seems to be integer or None
.
Maybe it could be a dependency problem because you were using numpy 1.19.5
and I am on 1.21.2
.
Update: It seems that it is a tensorflow-version problem: https://github.com/keras-team/keras/issues/15536
The model for prediction differs from the model for training, but I cannot explain this in just a couple of words.
Hi! Any update / fix? I've got exactly the same issue on my Raspberry Pi.
Thank you for the great work. I just tried out the localizer with the hands_on_demo.py. Capturing the dataset and training seems to work, but during the prediction it seems to have problems (maybe related to #3). I am using the tensorflow metal package and running it on an M1. And yes, I am using a standard RGB webcam.
Would be great if you could give me a hint what could be the problem here: