오히려 좋아..

상황이 나쁘게만 흘러가는 것 같을 때 외쳐보자.. .

궁금한 마음으로 포트폴리오 보기

Language/Python

[Python] pickle 파일 module '__main__' has no attribute 'something'

junha6316 2020. 11. 22. 11:24

www.stefaanlippens.net/python-pickling-and-dealing-with-attributeerror-module-object-has-no-attribute-thing.html

 

Python: pickling and dealing with "AttributeError: 'module' object has no attribute 'Thing'" - Stefaan Lippens inserts content h

The pickle module of python is a very handy module if you want to store and retrieve your python data structures to and from a file. Using that module you don't need to waste your time on writing your own export and import functions any more. We will write

www.stefaanlippens.net

pickle 파일을 불러올 때 모듈이름을 지정해줘야한다.

 

something.__module__ = 'something'
joblib.dump(something, 'something.pkl')