AttributeError: 'AutoSklearnClassifier' object has no attribute 'load_models'
See original GitHub issueDescribe the bug
AttributeError: ‘AutoSklearnClassifier’ object has no attribute ‘load_models’ when trying to score the model with cross validator.
To Reproduce
Run the following code with some dataset in X and y:
from autosklearn.classification import AutoSklearnClassifier
from autosklearn.metrics import average_precision
if __name__ == '__main__':
clf = AutoSklearnClassifier(metric=average_precision, memory_limit=192*1024)
clf.fit(X, y)
cross_validate(clf, X, y, n_jobs=-1, scoring="average_precision")["test_score"].mean()
Expected behavior
I would expect a number to result from it.
Actual behavior, stacktrace or logfile
Stacktrace:
AttributeError Traceback (most recent call last)
<ipython-input-29-8d5e33cc8853> in <module>
----> 1 cross_validate(clf, Xfloat, y, n_jobs=-1, scoring="average_precision")["test_score"].mean()
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/sklearn/model_selection/_validation.py in cross_validate(estimator, X, y, groups, scoring, cv, n_jobs, verbose, fit_params, pre_dispatch, return_train_score, return_estimator, error_score)
244 parallel = Parallel(n_jobs=n_jobs, verbose=verbose,
245 pre_dispatch=pre_dispatch)
--> 246 results = parallel(
247 delayed(_fit_and_score)(
248 clone(estimator), X, y, scorers, train, test, verbose, None,
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/joblib/parallel.py in __call__(self, iterable)
1039 # remaining jobs.
1040 self._iterating = False
-> 1041 if self.dispatch_one_batch(iterator):
1042 self._iterating = self._original_iterator is not None
1043
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/joblib/parallel.py in dispatch_one_batch(self, iterator)
829 big_batch_size = batch_size * n_jobs
830
--> 831 islice = list(itertools.islice(iterator, big_batch_size))
832 if len(islice) == 0:
833 return False
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/sklearn/model_selection/_validation.py in <genexpr>(.0)
246 results = parallel(
247 delayed(_fit_and_score)(
--> 248 clone(estimator), X, y, scorers, train, test, verbose, None,
249 fit_params, return_train_score=return_train_score,
250 return_times=True, return_estimator=return_estimator,
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/sklearn/utils/validation.py in inner_f(*args, **kwargs)
61 extra_args = len(args) - len(all_args)
62 if extra_args <= 0:
---> 63 return f(*args, **kwargs)
64
65 # extra_args > 0
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/sklearn/base.py in clone(estimator, safe)
72
73 klass = estimator.__class__
---> 74 new_object_params = estimator.get_params(deep=False)
75 for name, param in new_object_params.items():
76 new_object_params[name] = clone(param, safe=False)
~/SageMaker/custom-miniconda/miniconda/envs/python_38/lib/python3.8/site-packages/sklearn/base.py in get_params(self, deep)
193 out = dict()
194 for key in self._get_param_names():
--> 195 value = getattr(self, key)
196 if deep and hasattr(value, 'get_params'):
197 deep_items = value.get_params().items()
AttributeError: 'AutoSklearnClassifier' object has no attribute 'load_models'
Environment and installation:
Please give details about your installation:
- OS: AWS Linux
- Using a Conda environment
- Python: 3.8
- Auto-sklearn version: 0.12.1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Auto-sklearn: How to load pickle file and run predict()
I have fitted a classification model using auto- ...
Read more >'sequential' object has no attribute 'predict_proba'
I found the solution is to make my model sequential. How the following model can be made sequential to get rid of this...
Read more >Releases — AutoSklearn 0.15.0 documentation - GitHub Pages
This has no influence on any user-facing code. ... FIX #1432: Fixes an issue in which the AutoSklearnClassifier.leaderboard() or ...
Read more >PYTHON : AttributeError: 'module' object has no attribute 'model'
PYTHON : AttributeError : 'module' object has no attribute 'model' [ Gift : Animated Search Engine : https://www.hows.tech/p/recommended.html ] ...
Read more >Object has no attribute 'object' : r/django
AttributeError at /recipebook/addrecipe 'addrecipe' object has no attribute 'object'. Does anyone have any idea what I need to do to get ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This was fixed via #1063 and will be present in the next release we’re currently preparing via #1081.
I have the same error.
System: WSL2 (ubuntu) Code:
Error:
I decided to look at the attributes, and I see there is a _load_models: