未验证 提交 097714ca 编写于 作者: J jerrywgz 提交者: GitHub

refine py3 for LRC (#8)

上级 693ab9b8
......@@ -127,6 +127,9 @@ def reader_creator_filepath(filename, sub_name, is_training, args):
datasets = []
for name in names:
print("Reading file " + name)
try:
batch = pickle.load(open(filename + name, 'rb'), encode='latin1')
except TypeError:
batch = pickle.load(open(filename + name, 'rb'))
data = batch['data']
labels = batch.get('labels', batch.get('fine_labels', None))
......
......@@ -12,6 +12,8 @@ pred = np.zeros((10000, 10))
fl.sort()
i = 0
for f in fl:
if 'init' in f:
continue
print(f)
pred += pickle.load(open(os.path.join(model_path, f)))
print(np.mean(np.argmax(pred, axis=1) == labels))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册