Skip to content

[Windows] saving/loading TSNEEmbedding objects to pickle, Directory error #210

Open
@tomcsojn

Description

@tomcsojn
Expected behaviour

On Windows OS, when trying to save the TSNEEmbedding object, or affinities, tried to save it with
pickle.dump(embeddings,open(os.path.join(self.models_path,"tsne_global_embeddings.sav"),"wb"))
or also tried to save as array to reconstruct the object later using numpy.save("file.npy",affinities)

These lines both work just fine under linux distributions what I tried.
But loading them back on Windows breaks with the same error as on the save methods, both scenario.

Actual behaviour

Windows OS can't find/create the temporary directory/files when trying to touch the file. unfortunately I haven't had more time to look deeper into it yet, what could cause this behaviour.

*** NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\tomcs\\AppData\\Local\\Temp\\tmp7biujwdz\\tmp.ann

Steps to reproduce the behavior

opentsne==0.6.2

I think this would be the same with most settings. although I am using the following settings to train before trying to save.

affinities = openTSNE.affinity.PerplexityBasedNN( X, perplexity=500, n_jobs=32, random_state=0, )
init = openTSNE.initialization.pca(X,n_components=3, random_state=42)
tsne = openTSNE.TSNE(3, exaggeration=None, n_jobs=16, verbose=True, negative_gradient_method ="bh" )
embeddings = tsne.fit(affinities=affinities, initialization=init)
pickle.dump(embeddings,open("tsne_global_embeddings.sav","wb"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions