import pickle import numpy as np def save_obj(obj, name): with open(name + ‘.pkl‘, ‘wb‘) as f: pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL) def load_obj(name): with open(name + ‘.pkl‘, ‘rb‘) as f: return pickle.load(f) a = load_obj(‘logistic_regression_res‘) W = np.array(a[‘W‘]) b = np.array(a[‘b‘]) print(W) print(b)
原文地址:https://www.cnblogs.com/CK85/p/10252144.html
时间: 2024-11-13 10:11:05