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

AttributeError: type object 'object' has no attribute 'dtype', even on files given in explanation #162

Open
henryxu0 opened this issue Apr 14, 2022 · 0 comments

Comments

@henryxu0
Copy link

henryxu0 commented Apr 14, 2022

  • ATM version: 0.2.3
  • Python version: 3.8.5
  • Operating System: Windows

Description

When I just ran

from atm import ATM

atm = ATM()
results = atm.run(train_path='pollution_1.csv')

The pollution_1.csv file is the same file that is given in the explanation.

I got a very long error message that kept repeating saying AttributeError: type object 'object' has no attribute 'dtype'. I googled the error and it said to upgrade my pandas package, so I upgraded it to pandas 1.3.2. However, I still get the error message. What do I need to do in order to properly run the ATM package?

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

from atm import ATM

atm = ATM()
results = atm.run(train_path='pollution_1.csv')

Output:

Processing dataset pollution_1.csv
  0%|                                                                                          | 0/100 [00:00<?, ?it/s]Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: pending>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.

  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.
  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.

  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.
  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.

  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.
  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.

  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.
  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.

  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.
  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

Something went wrong. Sleeping 5 seconds.

  0%|                                                                                          | 0/100 [00:05<?, ?it/s]
Error testing classifier: datarun=<ID = 5, dataset ID = 5, strategy = uniform___uniform, budget = classifier (100), status: running>
Traceback (most recent call last):
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 399, in run_classifier
    model, metrics = self.test_classifier(hyperpartition.method, params)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\worker.py", line 207, in test_classifier
    metrics = model.train_test(self.dataset)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 214, in train_test
    cv_scores = self._cross_validate(X_train, y_train)
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\classifier.py", line 136, in _cross_validate
    df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
  File "C:\Users\henry\anaconda3\lib\site-packages\atm\metrics.py", line 214, in cross_validate_pipeline
    df = pd.DataFrame(columns=metrics)
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\frame.py", line 392, in __init__
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\internals\construction.py", line 195, in init_dict
  File "C:\Users\henry\anaconda3\lib\site-packages\pandas\core\dtypes\cast.py", line 1175, in construct_1d_arraylike_from_scalar
AttributeError: type object 'object' has no attribute 'dtype'

this goes on for several iterations, more than I can include.

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

1 participant