Pickle incompatibility of numpy arrays between Python 2 and 3

前端 未结 7 1674
遥遥无期
遥遥无期 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 02:11

    It looks like there are some compatablility issues in pickle between 2.x and 3.x due to the move to unicode. Your file appears to be pickled with python 2.x and decoding it in 3.x could be troublesome.

    I'd suggest unpickling it with python 2.x and saving to a format that plays more nicely across the two versions you're using.

提交回复
热议问题