I'm trying to run TensorFlow's translate.py file, but after a few seconds already I keep getting this error:
tarfile.ReadError: unexpected end of data
I have no idea why this happens and I've tried several things, including downloading the needed data myself and comment the line in the code that do the downloading, but nothing worked.
Here is the site that I follow:
https://www.tensorflow.org/tutorials/seq2seq
And just in case you need everything, here are the lines from the command to the error:
C:\Users\Mueller>python translate.py
Preparing WMT data in /tmp
Extracting tar file /tmp\training-giga-fren.tar
Traceback (most recent call last):
File "translate.py", line 322, in <module>
tf.app.run()
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\site-package
s\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "translate.py", line 319, in main
train()
File "translate.py", line 173, in train
FLAGS.data_dir, FLAGS.from_vocab_size, FLAGS.to_vocab_size)
File "C:\Users\Mueller\data_utils.py", line 267, in prepare_wmt_data
train_path = get_wmt_enfr_train_set(data_dir)
File "C:\Users\Mueller\data_utils.py", line 83, in get_wmt_enfr_train_set
corpus_tar.extractall(directory)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 1996, in extractall
numeric_owner=numeric_owner)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 2038, in extract
numeric_owner=numeric_owner)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 2108, in _extract_member
self.makefile(tarinfo, targetpath)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 2156, in makefile
copyfileobj(source, target, tarinfo.size, ReadError)
File "C:\Users\Mueller\AppData\Local\Programs\Python\Python35\lib\tarfile.py",
line 243, in copyfileobj
raise exception("unexpected end of data")
tarfile.ReadError: unexpected end of data
Does anybody know what is happening here?
If your machine is running behind a proxy server, its possible that the downloaded tar file maybe getting stripped/blocked by proxy server, resulting in corrupted downloaded file.
Related
Good afternoon! I'm asking for help, I can't figure out python buildozer for a day, I've already prepared everything, and at the final stage, when the "buildozer android debug" command is entered into the terminal, it gives such an error at the end. Can anyone tell me what to do about it and how to fix it?
Here is the error itself:
Traceback (most recent call last):
File "/usr/local/bin/buildozer", line 11, in <module>
load_entry_point('buildozer==0.40.dev0', 'console_scripts', 'buildozer')()
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 1071, in run_command
self.target.run_commands(args)
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/target.py", line 92, in run_commands
func(args)
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/target.py", line 102, in cmd_debug
self.buildozer.prepare_for_build()
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 178, in prepare_for_build
self.target.install_platform()
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/targets/android.py", line 666, in install_platform
self._install_android_ndk()
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/targets/android.py", line 459, in _install_android_ndk
cwd=self.buildozer.global_platform_dir)
File "/usr/local/lib/python3.6/dist-packages/buildozer-0.40.dev0-py3.6.egg/buildozer/__init__.py", line 699, in download
urlretrieve(url, filename, report_hook)
File "/usr/lib/python3.6/urllib/request.py", line 1826, in retrieve
block = fp.read(bs)
File "/usr/lib/python3.6/tempfile.py", line 624, in func_wrapper
return func(*args, **kwargs)
ValueError: read of closed file
I tried to find an answer to this question, but so far without success.
I am getting error on connecting socket, when I run python code it work fine despite the exe format,
I tried some solutions on internet but nothing
Traceback (most recent call last):
File "threading.py", line 926, in _bootstrap_inner
File "threading.py", line 870, in run
File "spectre_code.py", line 242, in start
File "websocket\_core.py", line 211, in connect
File "websocket\_http.py", line 77, in connect
File "websocket\_http.py", line 179, in _ssl_socket
File "websocket\_http.py", line 138, in _wrap_sni_socket
TypeError: cafile, capath and cadata cannot be all omitted
I tried this:
ssl_defaults = ssl.get_default_verify_paths()
sslopt_ca_certs = {'ca_certs': ssl_defaults.cafile}
history = websocket.WebSocket(sslopt=sslopt_ca_certs)
history.connect("wss://wss.hyper-api.com:5553/spectreai/",
header=[protocol_str])
But still not working, is the problem in library downloading, thanks!
I am trying to use the TensorFlow image classifier but halfway through the download my internet connection got lost and I could not download the file.
I understand that I have to delete the partial download and run again to make this work but I am not sure where the file is or how to find it.
I tried searching for the file name "Inception-2015-12-05.tgz" and nothing showed up. My guess is that there is a temporary file name when I downloaded it.
File "classify_image.py", line 227, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tarfile.py", line 2007, in extractall
numeric_owner=numeric_owner)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tarfile.py", line 2049, in extract
numeric_owner=numeric_owner)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tarfile.py", line 2119, in _extract_member
self.makefile(tarinfo, targetpath)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tarfile.py", line 2168, in makefile
copyfileobj(source, target, tarinfo.size, ReadError, bufsize)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tarfile.py", line 248, in copyfileobj
buf = src.read(bufsize)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/gzip.py", line 276, in read
return self._buffer.read(size)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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
Delete the /tmp/imagenet folder, then restart the download.
I followed the instruction to run the command "tensorbard --logdir ." and there are no graph at the Tensorboard graph page and i get these errors
Exception in thread Reloader:
Traceback (most recent call last):
File "c:\users\imkha\appdata\local\programs\python\python36\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "c:\users\imkha\appdata\local\programs\python\python36\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorboard\backend\application.py", line 350, in _reload_forever
reload_multiplexer(multiplexer, path_to_run)
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorboard\backend\application.py", line 322, in reload_multiplexer
multiplexer.AddRunsFromDirectory(path, name)
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorboard\backend\event_processing\plugin_event_multiplexer.py", line 175, in AddRunsFromDirectory
for subdir in GetLogdirSubdirectories(path):
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorboard\backend\event_processing\plugin_event_multiplexer.py", line 445, in <genexpr>
subdir
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorboard\backend\event_processing\io_wrapper.py", line 50, in ListRecursively
for dir_path, _, filenames in tf.gfile.Walk(top):
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 518, in walk
for subitem in walk(os.path.join(top, subdir), in_order):
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 518, in walk
for subitem in walk(os.path.join(top, subdir), in_order):
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 518, in walk
for subitem in walk(os.path.join(top, subdir), in_order):
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 499, in walk
listing = list_directory(top)
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 478, in list_directory
compat.as_bytes(dirname), status)
File "c:\users\imkha\appdata\local\programs\python\python36\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 473, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.UnknownError: FindFirstFile failed for: C:\Users\imkha\AppData\Local\Application Data : Access is denied.
; Input/output error
i have tried the debugging steps provided on the page but it did not seem to work. Thank you in advance. (OS:Windows 10)
I had the same problem and, as Rajat suggested, I used the cmd in administrator mode.
Worked like a charm.
I am trying to execute Run_Keyword.robot made with RIDE file which is in directory 'Robot' from python interpreter and getting following error. I am able to run this .py file from cmd without any error and it gives expected results. What can be the reason for this. I am a newbie to Robot Framework. Please help with this.
from robot import run
run('C:\\Users\\uvijayac\\Desktop\\Robot')
The Error I am getting is as follows.
Traceback (most recent call last):
File "C:\Users\uvijayac\Desktop\Robot\rf.py", line 27, in <module>
run_tests()
File "C:\Users\uvijayac\Desktop\Robot\rf.py", line 23, in run_tests
report=report_file)
File "C:\Python27\lib\site-packages\robot\run.py", line 471, in run
return RobotFramework().execute(*datasources, **options)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 83, in execute
return self._execute(list(arguments), options)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 89, in _execute
return self._report_error(unicode(err), help=True)
File "C:\Python27\lib\site-packages\robot\utils\application.py", line 110, in _report_error
self._logger.error(message)
File "C:\Python27\lib\site-packages\robot\output\loggerhelper.py", line 59, in error
self.write(msg, 'ERROR')
File "C:\Python27\lib\site-packages\robot\output\loggerhelper.py", line 62, in write
self.message(Message(message, level, html))
File "C:\Python27\lib\site-packages\robot\output\logger.py", line 109, in message
logger.message(msg)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 66, in message
self._writer.error(msg.message, msg.level, clear=self._running_test)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 142, in error
self._highlight('[ ', level, ' ] ' + message, error=True)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 158, in _highlight
self._write(before, newline=False, error=error)
File "C:\Python27\lib\site-packages\robot\output\monitor.py", line 154, in _write
stream.flush()
IOError: [Errno 9] Bad file descriptor
>>>