reloading - 实现程序运行时修改Python代码而不打断运行过程-python

上传者: 42176612 | 上传时间: 2022-05-16 23:39:34 | 文件大小: 580KB | 文件类型: ZIP
程序运行时修改Python代码而不打断运行过程,可在PyTorch程序训练过程中添加输出、查看统计、保存模型参数等 重新加载一个 Python 实用程序,用于在每次迭代时从源重新加载循环体而不会丢失状态 用于在深度学习模型训练期间编辑源代码。 这让您无需重新开始训练即可添加日志记录、打印统计信息或保存模型,因此不会丢失训练进度。 安装 pip install reloading 用法要在每次迭代之前从源代码重新加载 for 循环的主体,只需使用重新加载包装迭代器,例如 from reloading import reloading for i in reloading(range(10)): # here could be your training loop print (i) 要在每次执行之前从源重新加载函数,请使用 @reloading 修饰函数定义,例如 from reloading import reloading @reloading def some_function(): pass 示例 以下是如何使用您最喜欢的库重新加载的简短片段。 有关完整示例,请查看示例文件

文件下载

资源详情

[{"title":"( 20 个子文件 580KB ) reloading - 实现程序运行时修改Python代码而不打断运行过程-python","children":[{"title":"reloading-master","children":[{"title":"MANIFEST <span style='color:#111;'> 135B </span>","children":null,"spread":false},{"title":"reloading","children":[{"title":"reloading.py <span style='color:#111;'> 7.47KB </span>","children":null,"spread":false},{"title":"__init__.py <span style='color:#111;'> 33B </span>","children":null,"spread":false},{"title":"test_reloading.py <span style='color:#111;'> 5.27KB </span>","children":null,"spread":false}],"spread":true},{"title":"setup.cfg <span style='color:#111;'> 40B </span>","children":null,"spread":false},{"title":"examples","children":[{"title":"keras","children":[{"title":"train.py <span style='color:#111;'> 1.42KB </span>","children":null,"spread":false},{"title":"requirements.txt <span style='color:#111;'> 11B </span>","children":null,"spread":false}],"spread":true},{"title":"pytorch","children":[{"title":"train.py <span style='color:#111;'> 1.17KB </span>","children":null,"spread":false},{"title":"requirements.txt <span style='color:#111;'> 23B </span>","children":null,"spread":false}],"spread":true},{"title":"tensorflow","children":[{"title":"train.py <span style='color:#111;'> 2.86KB </span>","children":null,"spread":false},{"title":"requirements.txt <span style='color:#111;'> 15B </span>","children":null,"spread":false}],"spread":true},{"title":"fastai","children":[{"title":"train.py <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"requirements.txt <span style='color:#111;'> 6B </span>","children":null,"spread":false}],"spread":true},{"title":"demo","children":[{"title":"demo.gif <span style='color:#111;'> 661.36KB </span>","children":null,"spread":false},{"title":"demo.py <span style='color:#111;'> 266B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"setup.py <span style='color:#111;'> 1.22KB </span>","children":null,"spread":false},{"title":".gitignore <span style='color:#111;'> 95B </span>","children":null,"spread":false},{"title":"Makefile <span style='color:#111;'> 328B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 4.55KB </span>","children":null,"spread":false},{"title":"LICENSE.txt <span style='color:#111;'> 1.04KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明