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

"The backend of Task xxx has been removed" error under StatET #850

Open
comintel opened this issue Aug 22, 2022 · 4 comments
Open

"The backend of Task xxx has been removed" error under StatET #850

comintel opened this issue Aug 22, 2022 · 4 comments

Comments

@comintel
Copy link

comintel commented Aug 22, 2022

I have a variety of problems running mlr3 under StatET (https://projects.eclipse.org/projects/science.statet) on Windows 10.

Some of these problems include R crashes, but the easiest problem to reproduce is to just run the following example

library(mlr3)
task_penguins = as_task_classif(species ~ ., data = palmerpenguins::penguins)
learner = lrn("classif.rpart", cp = .01)
split = partition(task_penguins, ratio = 0.67)
learner$train(task_penguins, split$train_set)
prediction = learner$predict(task_penguins, split$test_set)
prediction$confusion

The output and traceback is shown below. The "Error:..." line appears 12 times every time you do anything from that point on!

This is exactly the same behavior under multiple recent R releases, multiple recent StatET releases, multiple MLR3 releases (this is the current code as of today) , and multiple Eclipse and Java releases. It does not occur using R alone without StatET.

What would be the best way to pursue this? I am happy to run any tracing you would suggest.

Thanks

================================

Output follows:

Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.

traceback()
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#925
2: .__Task__weights(self = self, private = private, super = super,
rhs = rhs) at Task.R#924
1: (function (rhs)
.__Task__weights(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.

@comintel comintel changed the title The backend of Task xxx has been removed error under StatET "The backend of Task xxx has been removed" error under StatET Aug 22, 2022
@comintel
Copy link
Author

Here is a better fuller traceback()

R version 4.2.1 Patched (2022-07-29 r82648 ucrt) -- "Funny-Looking Kid"
Copyright (C) 2022 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

library(mlr3)
options(error = traceback)
task_penguins = as_task_classif(species ~ ., data = palmerpenguins::penguins)
learner = lrn("classif.rpart", cp = .01)
split = partition(task_penguins, ratio = 0.67)
learner$train(task_penguins, split$train_set)

Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
No traceback available
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#887
2: .__Task__groups(self = self, private = private, super = super,
rhs = rhs) at Task.R#886
1: (function (rhs)
.__Task__groups(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#905
2: .__Task__order(self = self, private = private, super = super,
rhs = rhs) at Task.R#904
1: (function (rhs)
.__Task__order(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#863
2: .__Task__strata(self = self, private = private, super = super,
rhs = rhs) at Task.R#862
1: (function (rhs)
.__Task__strata(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#925
2: .__Task__weights(self = self, private = private, super = super,
rhs = rhs) at Task.R#924
1: (function (rhs)
.__Task__weights(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#887
2: .__Task__groups(self = self, private = private, super = super,
rhs = rhs) at Task.R#886
1: (function (rhs)
.__Task__groups(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#905
2: .__Task__order(self = self, private = private, super = super,
rhs = rhs) at Task.R#904
1: (function (rhs)
.__Task__order(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#863
2: .__Task__strata(self = self, private = private, super = super,
rhs = rhs) at Task.R#862
1: (function (rhs)
.__Task__strata(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#925
2: .__Task__weights(self = self, private = private, super = super,
rhs = rhs) at Task.R#924
1: (function (rhs)
.__Task__weights(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#887
2: .__Task__groups(self = self, private = private, super = super,
rhs = rhs) at Task.R#886
1: (function (rhs)
.__Task__groups(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#905
2: .__Task__order(self = self, private = private, super = super,
rhs = rhs) at Task.R#904
1: (function (rhs)
.__Task__order(self = self, private = private, super = super,
rhs = rhs))()
Error: The backend of Task 'palmerpenguins::penguins' has been removed. Set store_backends to TRUE during model fitting to conserve it.
5: stop(simpleError(str_wrap(sprintf(msg, ...), width = wrap), call = NULL))
4: stopf("The backend of Task '%s' has been removed. Set store_backends to TRUE during model fitting to conserve it.",
task$id) at assertions.R#302
3: assert_has_backend(self) at Task.R#863
2: .__Task__strata(self = self, private = private, super = super,
rhs = rhs) at Task.R#862
1: (function (rhs)
.__Task__strata(self = self, private = private, super = super,
rhs = rhs))()

@comintel
Copy link
Author

Looking at the tracebacks, I guess the problem may be StatET scanning all objects after every top-level line of R is executed in order to maintain its state.

If this is the case, would that regarded as the fault of StatET or of mlr3?

Thanks.

@be-marc
Copy link
Member

be-marc commented Aug 28, 2022

Hey, thanks for the bug report.

I guess the problem may be StatET scanning all objects after every top-level line of R is executed in order to maintain its state.

You are probably right. This could be a clash between R6 and StatET. learner$train() stores a copy of task_penguins without backend in learner$state$train_task. For example, if you call learner$state$train_task$groups() you get the same error message. The error message is correct because we cannot print the groups without the backend. Some time ago, we had a similar problem when using all.equal() on a task without a backend. all.equal() triggers all methods in an R6 object and some methods check for the backend. StatET probably also fails in a similar way.

I'm not sure what we can do about that. This might be a StatET bug related to R6 objects. Or StatET also uses all.equal() which means all.equal() must be fixed for R6 objects.

@comintel
Copy link
Author

Thanks so much for the reply! I really appreciate it.

I have opened an issue with StatET at https://gitlab.eclipse.org/eclipse/statet/statet/-/issues/32

and will see what he thinks ........

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants