TensorFlow:运行classify_image.py出现EOFError错误
在运行TensorFlow官方的教程Image Recogonition时出现错误
Traceback (most recent call last): File "classify_image.py", line 227, in <module> tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "D:\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 126, in run _sys.exit(main(argv)) File "classify_image.py", line 190, in main maybe_download_and_extract() File "classify_image.py", line 186, in maybe_download_and_extract tarfile.open(filepath, 'r:gz').extractall(dest_directory) File "D:\Anaconda3\lib\tarfile.py", line 2007, in extractall numeric_owner=numeric_owner) File "D:\Anaconda3\lib\tarfile.py", line 2049, in extract numeric_owner=numeric_owner) File "D:\Anaconda3\lib\tarfile.py", line 2119, in _extract_member self.makefile(tarinfo, targetpath) File "D:\Anaconda3\lib\tarfile.py", line 2168, in makefile copyfileobj(source, target, tarinfo.size, ReadError, bufsize) File "D:\Anaconda3\lib\tarfile.py", line 248, in copyfileobj buf = src.read(bufsize) File "D:\Anaconda3\lib\gzip.py", line 276, in read return self._buffer.read(size) File "D:\Anaconda3\lib\_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "D:\Anaconda3\lib\gzip.py", line 482, in read raise EOFError("Compressed file ended before the " EOFError: Compressed file ended before the end-of-stream marker was reached
原因是下载过程中被中断了,如果再次运行就会出现这个错误,解决方法是找到当前程序所在盘,找到tmp
缓存目录,删除下载缓存就可以了