Using Pickle.dump() to Save a PKL file to an Object

Viewed 96

I am trying to save a pkl file to an object M of the class obstacle_struct() using pickle.dump(). The line of code in question is:

pickle.dump(M,open('RRT_Models.pkl','wb'))

I am getting the following error:

"pickle.dump(M,open('RRT_Models.pkl', 'wb')) _pickle.PicklingError: Can't pickle <class 'main.obstacle_struct'>: attribute lookup obstacle_struct on main failed"

Any input is highly appreciated.

0 Answers
Related