ml4a / ml4a-ofx

A collection of openFrameworks apps for working with machine learning
http://ml4a.github.io
1.22k stars 279 forks source link

tSNE-images.py float32 not serializable by json.dumps #27

Closed cameronbergh closed 5 years ago

cameronbergh commented 6 years ago

json dumps wont serialize float32's. looks like this has been an issue for years idk wtf.

changing line 76 to this

    point = [np.float64((tsne[i, k] - np.min(tsne[:, k])) / (np.max(tsne[:, k]) - np.min(tsne[:, k]))) for k in
             range(tsne_dimensions)]

seems to fix the problem... at least for the imageTsneViewer program because i cant get imageTsneLive to compile

ubuntu 17.10, python3

genekogan commented 5 years ago

this should be fixed as of today. please let me know if it's still not working for you.