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

refine py3 for LRC (#8)

上级 693ab9b8
......@@ -127,7 +127,10 @@ def reader_creator_filepath(filename, sub_name, is_training, args):
datasets = []
for name in names:
print("Reading file " + name)
batch = pickle.load(open(filename + name, 'rb'))
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))
assert labels is not 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.
先完成此消息的编辑!
想要评论请 注册