Tensorflow数据集或tfds自动开始下载我想要的数据。我的系统中已下载cifar10。我可以使用以下方法直接在pytorch中加载数据:torchvision.datasets.CIFAR10('path / to / directory',...,download = False)
是否有与此相同的张量流或keras?
我认为您能做的最好的事情就是首先解压缩tar文件:
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()
然后访问模型数据并使用keras加载它:
https://www.tensorflow.org/api_docs/python/tf/keras/models/load_model
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句