【问题标题】:weights = 'noisy-student' ValueError: The `weights` argument should be either `None`, `imagenet`, or the path to the weights file to be loadedweights = 'noisy-student' ValueError: `weights` 参数应该是 `None`、`imagenet` 或要加载的权重文件的路径
【发布时间】:2020-09-27 20:50:27
【问题描述】:

我正在使用 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.

有人知道如何解决这个问题吗?

【问题讨论】:

    标签: python conv-neural-network valueerror efficientnet


    【解决方案1】:

    你可以从here下载权重。
    并像这样手动加载它:

    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)
    

    【讨论】:

      猜你喜欢
      • 2020-10-19
      • 1970-01-01
      • 2023-01-15
      • 2018-08-28
      • 1970-01-01
      • 2021-06-19
      • 1970-01-01
      • 1970-01-01
      • 2019-04-02
      相关资源
      最近更新 更多