手写数字识别遇到的问题,希望可以帮到大家

1、

D:\ProgramData\Anaconda3\python.exe "D:/Program Files/JetBrains/My Project/carry out.py"
Traceback (most recent call last):
  File "D:/Program Files/JetBrains/My Project/carry out.py", line 4, in
    training_data, validation_data, test_data = mnist_loader.load_data_wrapper()
  File "D:\Program Files\JetBrains\My Project\mnist_loader.py", line 68, in load_data_wrapper
    tr_d, va_d, te_d = load_data()
  File "D:\Program Files\JetBrains\My Project\mnist_loader.py", line 43, in load_data
    training_data, validation_data, test_data = pickle.load(f)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x90 in position 614: ordinal not in range(128)

解决方法

将training_data, validation_data, test_data = cPickle.load(f)
改为即可,training_data, validation_data, test_data = cPickle.load(f,encoding='bytes')


2、

D:\ProgramData\Anaconda3\python.exe "D:/Program Files/JetBrains/My Project/carry out.py"
Traceback (most recent call last):
  File "D:/Program Files/JetBrains/My Project/carry out.py", line 8, in
    net.SGD(training_data, 30, 10, 3.0, test_data=test_data)
  File "D:\Program Files\JetBrains\My Project\network.py", line 37, in SGD
    print("Epoch {0}: {1} / {2}".format(j, self.evluate(test_data),n_test))
AttributeError: 'Network' object has no attribute 'evluate'

很简单,打错单词了  应该是 evaluate

 

3、TypeError: object of type 'zip' has no len()

将minister改为以下内容 在zip 之前都加上list  ,使其列表化

 tr_d, va_d, te_d = load_data()
    training_inputs = [np.reshape(x, (784, 1)) for x in tr_d[0]]
    training_results = [vectorized_result(y) for y in tr_d[1]]
    training_data = list(zip(training_inputs, training_results))
    validation_inputs = [np.reshape(x, (784, 1)) for x in va_d[0]]
    validation_data = list(zip(validation_inputs, va_d[1]))
    test_inputs = [np.reshape(x, (784, 1)) for x in te_d[0]]
    test_data = list(zip(test_inputs, te_d[1]))
    return (training_data, validation_data, test_data)

 

你可能感兴趣的:(手写数字识别遇到的问题,希望可以帮到大家)