Code Monkey home page Code Monkey logo

Comments (3)

Luca96 avatar Luca96 commented on September 2, 2024

Hi, without the full traceback is a little bit difficult to understand where the error is, could you provide it?

from face-clustering.

nfurth avatar nfurth commented on September 2, 2024

/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:13: UserWarning: Model.fit_generator is deprecated and will be removed in a future version. Please use Model.fit, which supports generators.
del sys.path[0]
Epoch 1/12

TypeError Traceback (most recent call last)
in ()
11 shuffle=True,
12 callbacks=[checkpoint],
---> 13 verbose=1
14 )

2 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in autograph_handler(*args, **kwargs)
1145 except Exception as e: # pylint:disable=broad-except
1146 if hasattr(e, "ag_error_metadata"):
-> 1147 raise e.ag_error_metadata.to_exception(e)
1148 else:
1149 raise

TypeError: in user code:

File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1021, in train_function  *
    return step_function(self, iterator)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1010, in step_function  **
    outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 1000, in run_step  **
    outputs = model.train_step(data)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 860, in train_step
    loss = self.compute_loss(x, y, y_pred, sample_weight)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/training.py", line 919, in compute_loss
    y, y_pred, sample_weight, regularization_losses=self.losses)
File "/usr/local/lib/python3.7/dist-packages/keras/engine/compile_utils.py", line 201, in __call__
    loss_value = loss_obj(y_t, y_p, sample_weight=sw)
File "/usr/local/lib/python3.7/dist-packages/keras/losses.py", line 141, in __call__
    losses = call_fn(y_true, y_pred)
File "/usr/local/lib/python3.7/dist-packages/keras/losses.py", line 245, in call  **
    return ag_fn(y_true, y_pred, **self._fn_kwargs)
File "/usr/local/lib/python3.7/dist-packages/keras/losses.py", line 2199, in cosine_similarity
    y_true = tf.linalg.l2_normalize(y_true, axis=axis)

TypeError: Expected int64 passed to parameter 'y' of op 'Maximum', got 1e-12 of type 'float' instead. Error: Expected int64, but got 1e-12 of type 'float'.

Here are the library versions I am using:
OpenCV 4.1.2
Keras 2.8.0
Pandas 1.3.5
Numpy 1.21.5

If it helps a link to the notebook https://colab.research.google.com/drive/1eFgQqA6KC1acSCXbzc8ru5ffea5Oim7Q#scrollTo=dlfjYC2DrXhI

Thank you

from face-clustering.

Luca96 avatar Luca96 commented on September 2, 2024

Hi, you can try a couple of things:

  • Change the loss function to binary_crossentropy.
  • And/or replace all the keras related imports with tensorflow.keras, instead.

Let me know if the issue persists

from face-clustering.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.