Skip to content
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

Saving a loaded uwot model #88

Closed
ilyakorsunsky opened this issue Dec 8, 2021 · 2 comments
Closed

Saving a loaded uwot model #88

ilyakorsunsky opened this issue Dec 8, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@ilyakorsunsky
Copy link

Hi, I would like to be able to cache, load, and cache an object that stores a umap model for downstream prediction tasks. Unfortunately, I run into the error below when I try to re-save a loaded uwot object. Any thoughts on how to address this? Thanks in advance!

ERROR:

Error in envRefInferField(x, what, getClass(class(x)), selfEnv): ‘ann’ is not a valid field or method name for reference class “Rcpp_AnnoyEuclidean”

CODE:

ff <- matrix(rnorm(1000), 100, 10)

# Create the model:
model <- uwot::umap(X = ff, scale = TRUE, n_threads = 4, init = "spectral", 
                    metric = "euclidean", ret_model = TRUE)
model_file <- tempfile("mymodel")
# Save the model:
.x <- uwot::save_uwot(model, file = model_file)
# Load the model:
model2 <- uwot::load_uwot(file = model_file)
# Save the loaded model: 
uwot::save_uwot(model2, file = tempfile('mymodel2'))
@jlmelville jlmelville added the bug Something isn't working label Dec 9, 2021
@jlmelville
Copy link
Owner

Sorry about that, the save/load code remains a disaster. This should be fixed on master, but there was a new CRAN release very recently, so won't be showing up there for quite a while.

@jlmelville
Copy link
Owner

Think this got fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants