当前位置:网站首页>tf.keras.utils.get_file()
tf.keras.utils.get_file()
2022-07-31 05:09:00 【Erosion_ww】
作用:
如果文件尚未在缓存中,则从 URL 下载文件。
默认情况下,位于 url 源的文件会下载到 cache_dir ~/.keras,放置在 cache_subdir 数据集中,并指定文件名 fname。 因此文件 example.txt 的最终位置是 ~/.keras/datasets/example.txt。
参数:
tf.keras.utils.get_file(
fname=None, # 文件的名称。 若指定了绝对路径 /path/to/file.txt,则文件将保存在该位置。 若没有,将使用原始文件的名称。
origin=None, # 文件的原始 URL。
untar=False, # 已弃用,取而代之的是 extract 参数。 布尔值,文件是否应该被解压
md5_hash=None, # 已弃用,取而代之的是 file_hash 参数。 用于验证的文件的 md5 哈希
file_hash=None, # 下载后文件的预期哈希字符串。 同时支持 sha256 和 md5 哈希算法。
cache_subdir='datasets', # 保存文件的 Keras 缓存目录下的子目录。 如果指定了绝对路径 /path/to/folder,则文件将保存在该位置。
hash_algorithm='auto', # 选择哈希算法来验证文件。 有“md5”、“sha256”和“auto”。 默认的“自动”检测正在使用的哈希算法。
extract=False, # True 尝试将文件解压缩为存档,例如 tar 或 zip。
archive_format='auto', # 尝试提取文件的存档格式。 有“auto”、“tar”、“zip”和“无”。 'tar' 包括 tar、tar.gz 和 tar.bz 文件。默认的 'auto' 对应于 ['tar', 'zip']。 None 或空列表将返回找不到匹配项。
cache_dir=None # 存储缓存文件的位置,当 None 默认为默认目录 ~/.keras/。
)
返回值
Path to the downloaded file
例子
dataset_path = keras.utils.get_file("auto-mpg.data", "http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data")
print(dataset_path)Downloading data from http://archive.ics.uci.edu/ml/machine-learning-databases/auto-mpg/auto-mpg.data 32768/30286 [================================] - 0s 7us/step 'C:\\Users\\Wu Caifeng\\.keras\\datasets\\auto-mpg.data'
主要参考:tf.keras.utils.get_file | TensorFlow Core v2.9.1 (google.cn)
边栏推荐
- Unity资源管理系列:Unity 框架如何做好资源管理
- Moment Pool Cloud quickly installs packages such as torch-sparse and torch-geometric
- SQL statement to range query time field
- 如何将项目部署到服务器上(全套教程)
- ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)
- Doris学习笔记之监控
- Goodbye to the cumbersome Excel, mastering data analysis and processing technology depends on it
- Minio上传文件ssl证书不受信任
- Numpy中np.meshgrid的简单用法示例
- DVWA shooting range environment construction
猜你喜欢

ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)

MySQL(更新中)

MySQL optimization: from ten seconds to three hundred milliseconds

【LeetCode-SQL每日一练】——2. 第二高的薪水

面试官竟然问我怎么分库分表?幸亏我总结了一套八股文

再见了繁琐的Excel,掌握数据分析处理技术就靠它了

sql语句-如何以一个表中的数据为条件据查询另一个表中的数据

Interviewer: If the order is not paid within 30 minutes, it will be automatically canceled. How to do this?

ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)Solution

MySQL transaction (transaction) (this is enough..)
随机推荐
pycharm专业版使用
Pytorch教程Introduction中的神经网络实现示例
Distributed Transactions - Introduction to Distributed Transactions, Distributed Transaction Framework Seata (AT Mode, Tcc Mode, Tcc Vs AT), Distributed Transactions - MQ
[Introduction to MySQL 8 to Mastery] Basics - silent installation of MySQL on Linux system, cross-version upgrade
参考代码系列_1.各种语言的Hello World
Puzzle Game Level Design: Reverse Method--Explaining Puzzle Game Level Design
Go中间件
mysql使用on duplicate key update批量更新数据
Sun Wenlong, Secretary General of the Open Atom Open Source Foundation |
ABC D - Distinct Trio (Number of k-tuples
Temporal介绍
信息系统项目管理师核心考点(五十五)配置管理员(CMO)的工作
Create componentized development based on ILRuntime hot update
Duplicate entry 'XXX' for key 'XXX.PRIMARY' solution.
ES 源码 API调用链路源码分析
为什么要用Flink,怎么入门使用Flink?
Linux的mysql报ERROR 1045 (28000) Access denied for user ‘root‘@‘localhost‘ (using password NOYSE)
限流的原理
面试Redis 高可靠性|主从模式、哨兵模式、Cluster集群模式
.NET-9. A mess of theoretical notes (concepts, ideas)