Issue
Tensorflow datasets or tfds automatically starts downloading the data I want. I have cifar10 downloaded in my system. I can directly load the data in pytorch using: torchvision.datasets.CIFAR10('path/to/directory',...,download=False)
Is there a tensorflow or keras equivalent of this?
Solution
I think that the best you can do is first extract the tar file:
import tarfile
if fname.endswith("tar.gz"):
tar = tarfile.open(fname, "r:gz")
tar.extractall()
tar.close()
elif fname.endswith("tar"):
tar = tarfile.open(fname, "r:")
tar.extractall()
tar.close()
and then access to the model data and load it using keras:
https://www.tensorflow.org/api_docs/python/tf/keras/models/load_model
Answered By - Cristian Zumelzu
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.