Pickle incompatibility of numpy arrays between Python 2 and 3

前端 未结 7 1656
遥遥无期
遥遥无期 2020-11-28 01:12

I am trying to load the MNIST dataset linked here in Python 3.2 using this program:

import pickle
import gzip
import numpy


with gzip.open(\'mnist.pkl.gz\',         


        
7条回答
  •  隐瞒了意图╮
    2020-11-28 01:57

    It appears to be an incompatibility issue between Python 2 and Python 3. I tried loading the MNIST dataset with

        train_set, valid_set, test_set = pickle.load(file, encoding='iso-8859-1')
    

    and it worked for Python 3.5.2

提交回复
热议问题