From 7840ddfd4fd02569ca3524b6ecc4a960e8dd408a Mon Sep 17 00:00:00 2001 From: whs Date: Wed, 16 Dec 2020 10:25:52 +0800 Subject: [PATCH] move imagenet.py to root of demo (#547) --- demo/{dygraph/pruning => }/imagenet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename demo/{dygraph/pruning => }/imagenet.py (93%) diff --git a/demo/dygraph/pruning/imagenet.py b/demo/imagenet.py similarity index 93% rename from demo/dygraph/pruning/imagenet.py rename to demo/imagenet.py index 0760c866..71c5f13e 100644 --- a/demo/dygraph/pruning/imagenet.py +++ b/demo/imagenet.py @@ -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': -- GitLab