Skip to content

Commit b883a90

Browse files
authored
hash the data bytes to be compatible with python 3
Python 3's hash() function only accepts specific kinds of data, so converting the numpy array to bytes in order to hash it
1 parent ea26562 commit b883a90

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

notebooks/tensorflow/Tensorflow-1-NotMNIST.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,9 +878,9 @@
878878
"valid_dataset.flags.writeable = False\n",
879879
"test_dataset.flags.writeable = False\n",
880880
"\n",
881-
"train_hash = [hash(e.data) for e in train_dataset]\n",
882-
"valid_hash = [hash(e.data) for e in valid_dataset]\n",
883-
"test_hash = [hash(e.data) for e in test_dataset]\n",
881+
"train_hash = [hash(e.tobytes()) for e in train_dataset]\n",
882+
"valid_hash = [hash(e.tobytes()) for e in valid_dataset]\n",
883+
"test_hash = [hash(e.tobytes()) for e in test_dataset]\n",
884884
"\n",
885885
"unique_train_hash = set(train_hash)\n",
886886
"valid_overlap = unique_train_hash.intersection(set(valid_hash))\n",

0 commit comments

Comments
 (0)