-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: Can't get attribute 'tokenizer' on <module '__main__'> #81
Comments
Hm, this looks like some namespace issue. Pickle is very sensitive about that. Do you have the tokenizer defined in the vectorizer.py file, like so?
|
Also have this issue. Can confirm |
For what it's worth, doing:
Seemed to work for me. Thanks to digging around here https://stackoverflow.com/questions/40287657/load-pickled-object-in-different-file-attribute-error#comment67835396_40287657 |
Ah think I know the source of my issue. I was pickling the |
Thanks for the comments. Hm, that's weird, the SGDClassifier should behave exactly the same as the LogisticRegression classifier when it comes to pickling. I think in most cases, it's usually a namespace issue. Hope you were able to resolve it. |
Also I realized I picked the
|
Hi,
I am trying to test the pickled objects, to verify that I can import the vectorizer and unpickle the classifier.
However, I get this error:
----> 6 clf = pickle.load(open(os.path.join('pkl_objects', 'classifier.pkl'), 'rb'))
AttributeError: Can't get attribute 'tokenizer' on <module 'main'>
What is going on and how can I fix this error?
Thank you!
The text was updated successfully, but these errors were encountered: