Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
1a47a44d
Unverified
Commit
1a47a44d
authored
May 18, 2018
by
Soumith Chintala
Committed by
GitHub
May 18, 2018
Browse files
Revert "Load and parse metadata for CIFAR-10, CIFAR-100 (#502)" (#506)
This reverts commit
972b80c9
.
parent
972b80c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
19 deletions
+1
-19
torchvision/datasets/cifar.py
torchvision/datasets/cifar.py
+1
-19
No files found.
torchvision/datasets/cifar.py
View file @
1a47a44d
...
@@ -46,10 +46,6 @@ class CIFAR10(data.Dataset):
...
@@ -46,10 +46,6 @@ class CIFAR10(data.Dataset):
[
'test_batch'
,
'40351d587109b95175f43aff81a1287e'
],
[
'test_batch'
,
'40351d587109b95175f43aff81a1287e'
],
]
]
meta_list
=
[
[
'batches.meta'
,
'5ff9c542aee3614f3951f8cda6e48888'
],
]
def
__init__
(
self
,
root
,
train
=
True
,
def
__init__
(
self
,
root
,
train
=
True
,
transform
=
None
,
target_transform
=
None
,
transform
=
None
,
target_transform
=
None
,
download
=
False
):
download
=
False
):
...
@@ -104,16 +100,6 @@ class CIFAR10(data.Dataset):
...
@@ -104,16 +100,6 @@ class CIFAR10(data.Dataset):
self
.
test_data
=
self
.
test_data
.
reshape
((
10000
,
3
,
32
,
32
))
self
.
test_data
=
self
.
test_data
.
reshape
((
10000
,
3
,
32
,
32
))
self
.
test_data
=
self
.
test_data
.
transpose
((
0
,
2
,
3
,
1
))
# convert to HWC
self
.
test_data
=
self
.
test_data
.
transpose
((
0
,
2
,
3
,
1
))
# convert to HWC
f
=
self
.
meta_list
[
0
][
0
]
file
=
os
.
path
.
join
(
self
.
root
,
self
.
base_folder
,
f
)
fo
=
open
(
file
,
'rb'
)
if
sys
.
version_info
[
0
]
==
2
:
entry
=
pickle
.
load
(
fo
)
else
:
entry
=
pickle
.
load
(
fo
,
encoding
=
'latin1'
)
fo
.
close
()
self
.
meta
=
entry
def
__getitem__
(
self
,
index
):
def
__getitem__
(
self
,
index
):
"""
"""
Args:
Args:
...
@@ -147,7 +133,7 @@ class CIFAR10(data.Dataset):
...
@@ -147,7 +133,7 @@ class CIFAR10(data.Dataset):
def
_check_integrity
(
self
):
def
_check_integrity
(
self
):
root
=
self
.
root
root
=
self
.
root
for
fentry
in
(
self
.
train_list
+
self
.
test_list
+
self
.
meta_list
):
for
fentry
in
(
self
.
train_list
+
self
.
test_list
):
filename
,
md5
=
fentry
[
0
],
fentry
[
1
]
filename
,
md5
=
fentry
[
0
],
fentry
[
1
]
fpath
=
os
.
path
.
join
(
root
,
self
.
base_folder
,
filename
)
fpath
=
os
.
path
.
join
(
root
,
self
.
base_folder
,
filename
)
if
not
check_integrity
(
fpath
,
md5
):
if
not
check_integrity
(
fpath
,
md5
):
...
@@ -201,7 +187,3 @@ class CIFAR100(CIFAR10):
...
@@ -201,7 +187,3 @@ class CIFAR100(CIFAR10):
test_list
=
[
test_list
=
[
[
'test'
,
'f0ef6b0ae62326f3e7ffdfab6717acfc'
],
[
'test'
,
'f0ef6b0ae62326f3e7ffdfab6717acfc'
],
]
]
meta_list
=
[
[
'meta'
,
'7973b15100ade9c7d40fb424638fde48'
],
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment