Folks:
When I work on C3 Week3 Programming asisgnment Saimese Model Exercise 3 Train model, I got errors like this:
File “/usr/local/lib/python3.8/dist-packages/keras/src/engine/training.py”, line 1338, in train_function *
return step_function(self, iterator)
File “/tmp/ipykernel_14/512915329.py”, line 36, in norm *
return tf.math.l2_normalize(x, axis=1) # use tensorflow built in normalization
TypeError: Expected int32 passed to parameter 'y' of op 'Maximum', got 1e-12 of type 'float' instead. Error: Expected int32, but got 1e-12 of type 'float'.
I highly suspect it caused by Triplet loss function when I did:
def norm(x):
return tf.math.l2_normalize(x, axis=1) # use tensorflow built in normalization
sim = tf.linalg.matmul(norm(v2), norm(v1), transpose_b=True)
According to lab instructions. Anybody has any idea for that ?
Thanks.