erdogant / clustimage

clustimage is a python package for unsupervised clustering of images.
https://erdogant.github.io/clustimage
Other
92 stars 8 forks source link

Error while running clustimage module when embedding='tsne' #1

Closed spicker22 closed 2 years ago

spicker22 commented 2 years ago

An error occurs while running this module, clustimage. The error refers to the 'embedding' setting when "embedding='tsne'". If I run the code while "embedding='none'", it works fine. The concern is that embedding is very practical for visual purposes and should be used. Any ideas why this error occurs and how to resolve it?

setting

cl = Clustimage(method='pca',
                embedding='tsne',
                grayscale=False,
                dim=(128,128),
                params_pca={'n_components':0.95},
                store_to_disk=True,
                verbose=50)

error

File "/Users/name/opt/anaconda3/lib/python3.8/site-packages/sklearn/manifold/_t_sne.py", line 372, in _gradient_descent
    update = momentum * update - learning_rate * grad

UFuncTypeError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('<U32'), dtype('<U32')) -> dtype('<U32')

embedding references https://erdogant.github.io/clustimage/pages/html/clustimage.clustimage.html?highlight=embedding#clustimage.clustimage.Clustimage.embedding

erdogant commented 2 years ago

Thank you for reporting! I found the issue: learning_rate='auto' seems the problem. I simply removed the parameter. Update to the latest version:

pip install -U clustimage

spicker22 commented 2 years ago

i updated the clustimage and it worked!! thanks for this update, much appreciated!