with open(r'./record.pkl', 'rb') as inp:
res = []
try:
res.append(pickle.load(inp))
except:
noise_labels, true_labels = res[-2:]
有 bug, 但未测出来。
代码来源于 plot_loss_distribution.py
# ## bug!
# with open(r'./PN_CIFAR10/PN_CIFAR10_%.1f_loss_record/record_allrecord'%noise_rate, 'rb') as inp:
# res = []
# try:
# res.append(pickle.load(inp))
# except:
# print(res)
# noise_labels, true_labels = res[-2:]
# print(noise_labels)
# print(true_labels)
# print(len(res))
with open(r'./PN_CIFAR10/PN_CIFAR10_%.1f_loss_record/record_allrecord'%noise_rate, 'rb') as inp:
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
_ = pickle.load(inp)
#change in 2019.11.11
noise_labels = pickle.load(inp)
true_labels = pickle.load(inp)