save and load weights using pickle