2016-11-29 112 views
0

mnist = input_data.read_data_sets("MNIST_data", one_hot = True)を実行すると、次のエラーが発生します。私は手動でファイルを抽出し、MNIST_dataディレクトリに配置する場合 EOFError:ストリーム終了マーカーに達する前に圧縮ファイルが終了しました - MNISTデータセット

EOFError: Compressed file ended before the end-of-stream marker was reached

はさえ、プログラムがまだ抽出されたファイルを使用する代わりに、ファイルをダウンロードしようとしています。

手動でWinZipを使用してファイルを抽出すると、ファイルが壊れているとWinZipから通知されます。

どのようにこの問題を解決できますか?

データセットを読み込むこともできません。プログラム自体をデバッグする必要があります。助けてください。

Tensorflowがインストールされているため、Tensorflowの例はありません。そこで私はinput_dataファイルを取得するためにGitHubに行って、main.pyと同じディレクトリに保存しました。エラーは.gzファイルに関するものです。プログラムはそれを抽出できませんでした。

runfile('C:/Users/Nikhil/Desktop/Tensor Flow/tensf.py', wdir='C:/Users/Nikhil/Desktop/Tensor Flow') Reloaded modules: input_data Extracting MNIST_data/train-images-idx3-ubyte.gz C:\Users\Nikhil\Anaconda3\lib\gzip.py:274: VisibleDeprecationWarning: converting an array with ndim > 0 to an index will result in an error in the future return self._buffer.read(size) Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/Nikhil/Desktop/Tensor Flow/tensf.py', wdir='C:/Users/Nikhil/Desktop/Tensor Flow')

File "C:\Users\Nikhil\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile execfile(filename, namespace)

File "C:\Users\Nikhil\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Nikhil/Desktop/Tensor Flow/tensf.py", line 26, in mnist = input_data.read_data_sets("MNIST_data/", one_hot = True)

File "C:\Users\Nikhil\Desktop\Tensor Flow\input_data.py", line 181, in read_data_sets train_images = extract_images(local_file)

File "C:\Users\Nikhil\Desktop\Tensor Flow\input_data.py", line 60, in extract_images buf = bytestream.read(rows * cols * num_images)

File "C:\Users\Nikhil\Anaconda3\lib\gzip.py", line 274, in read return self._buffer.read(size)

File "C:\Users\Nikhil\Anaconda3\lib_compression.py", line 68, in readinto data = self.read(len(byte_view))

File "C:\Users\Nikhil\Anaconda3\lib\gzip.py", line 480, in read raise EOFError("Compressed file ended before the "

EOFError: Compressed file ended before the end-of-stream marker was reached

+0

このエラーは解決しましたか?私も同様のエラーが発生しています。 – Moondra

答えて

1

これは、何らかの理由でMNISTデータセットのダウンロードが不完全であるためです。

普通は~/.keras/datasetsにあるダウンロードしたフォルダ、またはこのパスに関連してあなたが指定した任意のパスを手作業で削除する必要があります(MNIST_data)。

は、ターミナルで次の手順を実行します(Ctrl + Alt + T):

  1. cd ~/.keras/datasets/
  2. rm -rf "dataset name"

はあなたが行ってもいいはずです!

関連する問題