Skip to content
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

Cosine distance is not compatible with TF import #70

Closed
idroz opened this issue Jun 4, 2020 · 1 comment
Closed

Cosine distance is not compatible with TF import #70

idroz opened this issue Jun 4, 2020 · 1 comment

Comments

@idroz
Copy link
Collaborator

idroz commented Jun 4, 2020

Current behaviour when using distance='cosine' throws an error:

AttributeError: module 'tensorflow.keras.losses' has no attribute 'cosine_distance'

Potential fix is changing module imports to: tf.compat.v1.losses.cosine_distance

@Szubie
Copy link
Collaborator

Szubie commented Jun 11, 2020

Fixed cosine distance calculation and made it work across multiple TensorFlow versions here: 9d8eb40

@Szubie Szubie closed this as completed Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants