tensorflow / similarity

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Self-Supervised Learning tutorial fails with latest TensorFlow Similarity

labroskokkalas opened this issue · comments

Self-Supervised Learning tutorial fails in contrastive_model training with

File "C:\Users\lone_\AppData\Local\Continuum\anaconda3\envs\tf28-gpu\lib\site-packages\keras\engine\training.py", line 1021, in train_function  *
    return step_function(self, iterator)
File "C:\Users\lone_\AppData\Local\Continuum\anaconda3\envs\tf28-gpu\lib\site-packages\tensorflow_similarity\losses\simsiam.py", line 111, in call  *
    loss: FloatTensor = (

TypeError: Missing required positional argument

Google Colab also fails.

It is a typo
loss: FloatTensor = (
tf.math.multiply(per_example_projection * 0.5) + self.margin
)
should change to

loss: FloatTensor = (
tf.math.multiply(per_example_projection, 0.5) + self.margin
)

Thanks for issue. I'll push a fix shortly.