提交 fee32b55 编写于 作者: Y yaohai

fix small error

上级 5fd7085d
......@@ -34,8 +34,8 @@ OPTIMIZER:
TRAIN:
batch_size: 256
num_workers: 4
file_list: "./dataset/NUS-SCENE-dataset/multilabel_train_list.txt"
data_dir: "./dataset/NUS-SCENE-dataset/images"
file_list: "./dataset/NUS-WIDE-SCENE/NUS-SCENE-dataset/multilabel_train_list.txt"
data_dir: "./dataset/NUS-WIDE-SCENE/NUS-SCENE-dataset/images"
shuffle_seed: 0
transforms:
- DecodeImage:
......@@ -59,8 +59,8 @@ TRAIN:
VALID:
batch_size: 64
num_workers: 4
file_list: "./dataset/NUS-SCENE-dataset/multilabel_test_list.txt"
data_dir: "./dataset/NUS-SCENE-dataset/images"
file_list: "./dataset/NUS-WIDE-SCENE/NUS-SCENE-dataset/multilabel_test_list.txt"
data_dir: "./dataset/NUS-WIDE-SCENE/NUS-SCENE-dataset/images"
shuffle_seed: 0
transforms:
- DecodeImage:
......
......@@ -89,8 +89,8 @@ class MultiLabelLoss(Loss):
def __init__(self, class_dim=1000, epsilon=None):
super(MultiLabelLoss, self).__init__(class_dim, epsilon)
def __call__(self, input, target, use_pure_fp16=False):
cost = self._binary_crossentropy(input, target, use_pure_fp16)
def __call__(self, input, target):
cost = self._binary_crossentropy(input, target)
return cost
......
......@@ -72,6 +72,11 @@ def main():
for number, result_dict in enumerate(batch_result_list):
filename = img_path_list[number].split("/")[-1]
clas_ids = result_dict["clas_ids"]
if multilabel:
print("File:{}, multilabel result: ".format(filename))
for id, score in zip(clas_ids, result_dict["scores"]):
print("\tclass id: {}, probability: {:.2f}".format(id, score))
else:
scores_str = "[{}]".format(", ".join("{:.2f}".format(
r) for r in result_dict["scores"]))
print("File:{}, Top-{} result: class id(s): {}, score(s): {}".
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册