I am new to programming and trying my hand at training an AI model with the MNIST database of handwritten digits. I already have a code that's working but now want to delve more into the details.
First thing I have to do in this project is to read through the .gz extension files, where integers are stored in the MBS first format. I have done this successfully by following code:
[ urllib.request.urlretrieve("http://yann.lecun.com/exdb/mnist/%s.gz" % file, "%s.gz" % file)
with gzip.open("%s.gz" % file, "rb") as f_in:
with open("%s" % file, "wb") as f_out:
shutil.copyfileobj(f_in, f_out)][1]
I checked the description of what the urllib.request.urlretrieve() does and it says "Retrieve a URL into a temporary location on disk".
I want to understand if it's possible to do this same task without creating a local copy. Is it possible to read through an online .gz file in a different way without urlretrieve?
This is not a problem. I'm just curious and want to understand it better.