未验证 提交 7840ddfd 编写于 作者: W whs 提交者: GitHub

move imagenet.py to root of demo (#547)

上级 186960cc
......@@ -34,10 +34,10 @@ class ImageNetDataset(DatasetFolder):
self.samples = []
list_file = "train_list.txt" if self.mode == "train" else "val_list.txt"
with open(os.path.join([path, list_file]), 'r') as f:
with open(os.path.join(path, list_file), 'r') as f:
for line in f:
_image, _label = line.strip().split(" ")
self.samples.append((_image, int(_label)))
self.samples.append((os.path.join(path, _image), int(_label)))
normalize = transforms.Normalize(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.120, 57.375])
if self.mode == 'train':
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册