-
Notifications
You must be signed in to change notification settings - Fork 167
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
[Windows] saving/loading TSNEEmbedding objects to pickle, Directory error #244
Comments
Just as a sanity check, does the unpickling fail if you run |
Tried the above code on Windows 10 and it works without issue.
And it shows:
My environment is as follows:
Maybe it is fixed or caused by other factors? |
I have the same issue: it seems to happen when the dataset is large. I think it is due to nearest_neighbors.py > setstate where AnnoyIndex needs to load from a file 'tmp.ann' but the file will then be deleted by the with block in the temp folder.
I wonder if self.index.load can load from memory or disable memory mapping to free/close the file after loading. spotify/annoy#629 |
For now, a temporary fix is to keep the data in the temp folder to be used by AnnoyIndex. Replace these four lines to
Note the |
I'm experiencing a similar issue when working on Ubuntu with NFS as the openTSNE file system.
My assumption is that the code "works" without issues on standard unix/linux based systems due to the Perhaps I'm wrong but this makes sense to me, especially after reading this comment in issue #210 |
Moved discussion to #210. |
I'm reopening a previously closed issue (#210)
In version 1.0.0, the problem still occurs. I tried running my code as administrator and the issue persists.
There seems to be a problem where the ann file is used by two processes simultaneously
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
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\tobia\\AppData\\Local\\Temp\\tmpvvo0p0t8\\tmp.ann'
Steps to reproduce the behavior
opentsne >= 0.6.2
The text was updated successfully, but these errors were encountered: