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: 'NoneType' object has no attribute 'path' #1149

Closed
lamres opened this issue May 25, 2021 · 4 comments
Closed

AttributeError: 'NoneType' object has no attribute 'path' #1149

lamres opened this issue May 25, 2021 · 4 comments
Assignees
Labels

Comments

@lamres
Copy link

lamres commented May 25, 2021

Hi.

Describe the bug

I get this error:
Exception ignored in: <function AutoML.__del__ at 0x7fc570a90430> Traceback (most recent call last): File "/opt/anaconda3/lib/python3.8/site-packages/autosklearn/automl.py", line 1564, in __del__ File "/opt/anaconda3/lib/python3.8/site-packages/autosklearn/util/backend.py", line 155, in delete_directories File "/opt/anaconda3/lib/python3.8/site-packages/autosklearn/util/backend.py", line 108, in temporary_directory AttributeError: 'NoneType' object has no attribute 'path'

To Reproduce

Steps to reproduce the behavior:

  1. Load the model from a pickle.
  2. Make a prediction. The prediction is ok.
  3. This error occurs in the end of code.

Installation

Python 3.8 on MacOS, the version of the auto-sklearn is 0.12.6

@franchuterivera
Copy link
Contributor

Hello, thanks for reporting.

If I take a simple classification example like this and add this line at the end:

  import pickle
  import gc
   with open('estimator.pickle', 'wb') as handle:
       pickle.dump(automl, handle, protocol=pickle.HIGHEST_PROTOCOL)
   
   del automl
   gc.collect()
   
   with open('estimator.pickle', 'rb') as handle:
       b = pickle.load(handle)
   del b
   gc.collect()

I am not able to reproduce. Furthermore, if I then open a python session and do:

>>> import pickle
>>> with open('estimator.pickle', 'rb') as handle:
...     b = pickle.load(handle)
>>> b.predict(<input>)
>>>exit()

How is your use case different? I do not know if this problem in your case is specific to MacOS. Is it possible to reproduce this on a virtual machine with for example Ubuntu?

@stevca9
Copy link

stevca9 commented Jun 10, 2021

I'm receiving the same error message as well:

Exception ignored in: <function AutoML.__del__ at 0x2b4791023ca0>
Traceback (most recent call last):
  File "/opt/software/auto-sklearn/lib/python3.8/site-packages/autosklearn/automl.py", line 1564, in __del__
  File "/opt/software/auto-sklearn/lib/python3.8/site-packages/autosklearn/util/backend.py", line 121, in delete_directories
  File "/opt/software/auto-sklearn/lib/python3.8/site-packages/autosklearn/util/backend.py", line 101, in output_directory
AttributeError: 'NoneType' object has no attribute 'path'

Currently running Python 3.8.10 with auto-sklearn version 0.12.6

I was able to produce this error with the simple classification example linked above.

I am running on RHEL7 in a Python virtual environment.

@franchuterivera
Copy link
Contributor

Thanks a lot for reporting. I was able to reproduce this problem on red hat, and I am proposing a PR that will be available on the next release to solve this problem.

@eddiebergman
Copy link
Contributor

eddiebergman commented Aug 10, 2021

This was addressed with PR #1155 and is now in the development branch. It will be in the master release next week or the following. Hopefully this fixes the error for now so I will close the issue but if the issue arises again, please feel free to comment here and I will re-open it!

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

No branches or pull requests

4 participants