Skip to content

Commit

Permalink
Merge pull request #5 from hyllevask/Fix_loading_svhn_dataset
Browse files Browse the repository at this point in the history
Fixed the loading for svhn datset
  • Loading branch information
vinaychandranp authored May 3, 2019
2 parents 84d84a2 + 32f2d82 commit c2fd28a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/data/get_a_dataset.py
Original file line number Diff line number Diff line change
@@ -93,13 +93,13 @@ def svhn(args):
torchvision.datasets.SVHN(root=args.output_folder, split='test', download=True)

# Load the data into memory
train = scipy.io.loadmat(os.path.join(args.output_folder,
train = _loadmat(os.path.join(args.output_folder,
'train_32x32.mat'))
train_data, train_labels = train['X'], train['y'].astype(np.int64).squeeze()
np.place(train_labels, train_labels == 10, 0)
train_data = np.transpose(train_data, (3, 0, 1, 2))

test = scipy.io.loadmat(os.path.join(args.output_folder,
test = _loadmat(os.path.join(args.output_folder,
'test_32x32.mat'))
test_data, test_labels = test['X'], test['y'].astype(np.int64).squeeze()
np.place(test_labels, test_labels == 10, 0)

0 comments on commit c2fd28a

Please sign in to comment.