python - weights = 'noisy-student' ValueError: `weights` 参数应该是 `None`、`imagenet` 或要加载的权重文件的路径
问题描述
我正在使用 Google Colab,我想使用 EfficientNet Noisy Student 的权重。https://www.kaggle.com/c/bengaliai-cv19/discussion/132894
首先,我通过以下方式安装了软件包:
!pip install git+https://github.com/qubvel/efficientnet
然后我尝试了上面提到的网站上的代码:
import efficientnet.keras as eff
model = eff.EfficientNetB0(weights='noisy-student')
并得到这个值错误:
ValueError: The `weights` argument should be either `None` (random initialization), `imagenet` (pre-training on ImageNet), or the path to the weights file to be loaded.
有人知道如何解决这个问题吗?
解决方案
你可以从这里下载权重。
并像这样手动加载它:
path_to_weights = "/..your..path../efficientnet-b5_noisy-student_notop.h5"
model = EfficientNetB5(include_top=False)
model.load_weights(path_to_weights, by_name=True)
推荐阅读
- reactjs - 使用 react-simple-file-upload 显示图像时遇到问题
- jira - 如何从 openproject 导出所有用户故事(要在 jira 中导入)?
- android - 如何找出用于 AlertDialog 的主题?
- regex - 如果退出,如何匹配可选组?
- linux - 如何在 Linux 内核上跟踪 CMA 分配?
- android - 服务时间测量
- android - Jetpack Compose,TextField中的自定义光标位置
- node.js - 如何避免对包含 URL 的字段进行 CSV 注入?
- python - 使用 python 对日期时间进行 HTML 编码
- swift - 全屏模式下另一个应用程序前面的“NSApp.activate”