2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[tensorflow]データセットの読み込み時のエラー対処

Last updated at Posted at 2019-10-24

エラー内容(EOFError)

以下のコードの実行時に

from keras.datasets import fashion_mnist
(x_train, t_train), (x_test, t_test) = fashion_mnist.load_data()

以下のエラーが発生した.
EOFError : Compressed file ended before the end-of-stream marker was reached

対処法

[参考]https://stackoverflow.com/questions/40877781/eoferror-compressed-file-ended-before-the-end-of-stream-marker-was-reached-mn

これはデータセットからのfasion mnistのダウンロードが, 何かしらの理由で不完全に止まってしまい, 中途半端なものがダウンロードされていることに原因があるようだ.

そこで, ターミナルで以下のコマンドを打つ(mac環境).

cd ~/.keras/datasets/
ls                    # ディレクトリfashion-mnistが表示されているはず.
rm -r fashion-mnist   # これをディレクトリごと消去する.

これを実行すれば, データセットからのfasion mnistのダウンロードが可能になる. イメージとしは, 不完全にダウンロードしたfasion mnistを全て消去して, その上で再び1からダウンロードをすれば良い.

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?