【问题标题】:Error in updating final FC layer for fine tuning AlexNet为微调 AlexNet 更新最终 FC 层时出错
【发布时间】:2017-06-12 01:45:37
【问题描述】:

您好,我最近开始为我自己的数据集微调 Alexnet 模型。

我想修改最后两层,因为我只有两个类:

net.layers = net.layers(1:end-2); 

但是当我像这样修改最终的 FC 层时,它给了我错误。

net.layers{end+1} = struct('type', 'conv',...
'weights', {{f*randn(1,1,4196,2, 'single'), zeros(1,2,'single')}},...
'stride', [1 1],...
'pad', [0 0 0 0]) ;
Cell contents assignment to a non-cell array object.

任何人,请帮我解决错误

谢谢

更新:

【问题讨论】:

    标签: matlab computer-vision deep-learning conv-neural-network matconvnet


    【解决方案1】:

    您的网络似乎是一个 DagNN。您不能像 simplenn 那样添加层。您可以修改 net.layer(end) 的相应 net.param(.) 中的权重矩阵(假设 net.layer(end) 是最终的 FC)或删除最后一层并使用帮助器自己添加一个新层@DagNN 文件夹中提供的函数(即 removeLayer 和 addLayer)。注意 removeLayer 和 addLayer 是 DagNN 类的私有函数。

    【讨论】:

      猜你喜欢
      • 2015-12-08
      • 1970-01-01
      • 2017-08-25
      • 2021-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-05
      相关资源
      最近更新 更多