Skip to content

Commit a0b6865

Browse files
committed
make pickel proto version compatiable with py2
1 parent a267155 commit a0b6865

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

python/paddle/dataset/image.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def batch_images_from_tar(data_file,
104104
pickle.dump(
105105
output,
106106
open('%s/batch_%d' % (out_path, file_id), 'wb'),
107-
protocol=pickle.HIGHEST_PROTOCOL)
107+
protocol=2)
108108
file_id += 1
109109
data = []
110110
labels = []
@@ -113,9 +113,7 @@ def batch_images_from_tar(data_file,
113113
output['label'] = labels
114114
output['data'] = data
115115
pickle.dump(
116-
output,
117-
open('%s/batch_%d' % (out_path, file_id), 'wb'),
118-
protocol=pickle.HIGHEST_PROTOCOL)
116+
output, open('%s/batch_%d' % (out_path, file_id), 'wb'), protocol=2)
119117

120118
with open(meta_file, 'a') as meta:
121119
for file in os.listdir(out_path):

0 commit comments

Comments
 (0)