1

I'm trying to download a directory which I've compressed as a .tar file, using the code below. The .tar file seems to have downloaded but is much smaller than it is shown on colab. Also I get the error message below. Can someone please let me know what the error message below means and is there a better way to down load the files?

Code:

# compressing folder

!tar -cvf DVBPR.tar DVBPR/


# download files to local computer

from google.colab import files

files.download('DVBPR.tar')

Error:

Exception happened during processing of request from ('::ffff:127.0.0.1', 59040, 0, 0)
Traceback (most recent call last):
  File "/usr/lib/python3.6/socketserver.py", line 317, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 348, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.6/socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.6/socketserver.py", line 696, in __init__
    self.handle()
  File "/usr/lib/python3.6/http/server.py", line 418, in handle
    self.handle_one_request()
  File "/usr/lib/python3.6/http/server.py", line 406, in handle_one_request
    method()
  File "/usr/lib/python3.6/http/server.py", line 639, in do_GET
    self.copyfile(f, self.wfile)
  File "/usr/lib/python3.6/http/server.py", line 800, in copyfile
    shutil.copyfileobj(source, outputfile)
  File "/usr/lib/python3.6/shutil.py", line 82, in copyfileobj
    fdst.write(buf)
  File "/usr/lib/python3.6/socketserver.py", line 775, in write
    self._sock.sendall(b)
ConnectionResetError: [Errno 104] Connection reset by peer
Bob Smith
  • 36,107
  • 11
  • 98
  • 91
user3476463
  • 3,967
  • 22
  • 57
  • 117

2 Answers2

0

Read about this error here. I think this generally occurs due to non-availability of a good internet connection. Try it when you have a good connection.

You can also try to mount your drive as mentioned here and then copy it onto your drive. Then download your file using a download manager.

Abhishek Arya
  • 450
  • 4
  • 16
0

This post seemed to solve my issue. Instead of downloading locally I saved it to my google drive using the code in the post:

How to download large files (like weights of a model) from Colaboratory?

user3476463
  • 3,967
  • 22
  • 57
  • 117