替换者:呼叫中的不正确参数或丢失参数

发布于 2025-02-08 18:32:19 字数 1297 浏览 1 评论 0原文

我正在尝试使用MATLAB替换LayerGraph-Object中的一层。

我正在使用命令“替换器(lgraph,name,layer)”,该命令在以下URL中记录:

https://de.mathworks.com/help/help/deeplearning/ref/layergraph.replacelayer.html

显式行是:

lgraph = replaceLayer(lgraph,name,layer); 

lgraph是:lgraph

  DAGNetwork with properties:

     Layers: [144×1 nnet.cnn.layer.Layer]
Connections: [170×2 table]
 InputNames: {'data'}
OutputNames: {'classoutput'}

is where lgraph is wher完全连接)

和层本身具有以下属性:

layer = 

  FullyConnectedLayer with properties:

          Name: 'fc'

   Hyperparameters
     InputSize: 720
    OutputSize: 8

   Learnable Parameters
       Weights: [8×720 double]
          Bias: [8×1 double]

我已经尝试用具有相同数量输出数量的新的完全连接的层替换旧的完全连接的图层,因为我认为这些数字需要相同。但这仍然会引发完全相同的错误消息。

Check for incorrect argument data type or missing argument in call to function 'replaceLayer'.

现在我不知道接下来要做什么。

我已经尝试过的事情:

  1. 使用默认的权重限制,以便
  2. 使用旧(待更换)和新(插入的)完全连接的旧层的相同数量的输出使用相同数量的输出。

如果有人能帮助我,那会很酷,我找不到在Matlab-Forums中有用的东西。谢谢!

i am trying to replace a layer in my layergraph-object, using matlab.

I am using the command "replaceLayer(lgraph,name,layer)" , which is documented in the following URL:

https://de.mathworks.com/help/deeplearning/ref/layergraph.replacelayer.html

The explicit line is:

lgraph = replaceLayer(lgraph,name,layer); 

Where lgraph is:

  DAGNetwork with properties:

     Layers: [144×1 nnet.cnn.layer.Layer]
Connections: [170×2 table]
 InputNames: {'data'}
OutputNames: {'classoutput'}

the name is 'fc' (for fully connected)

and the layer itself with the following attributes:

layer = 

  FullyConnectedLayer with properties:

          Name: 'fc'

   Hyperparameters
     InputSize: 720
    OutputSize: 8

   Learnable Parameters
       Weights: [8×720 double]
          Bias: [8×1 double]

I already tried to replace the old fully connected layer with a new fully connected layer which has the same number of outputs, because i thought those numbers need to be the same. But it still throws the exact same error message.

Check for incorrect argument data type or missing argument in call to function 'replaceLayer'.

Now i don't know what to try next.

Things i already tried:

  1. Using a default weight-initialization so that the weight-attributes of the new layer are non-empty
  2. Using the same number of outputs for the old (to be replaced) and the new (inserted) fully-connected layer.

Would be cool if someone could help me, i did not find anything useful in the matlab-forums. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

简单 2025-02-15 18:32:19

修复了它,我需要添加以下行:

lgraph=layerGraph(lgraph);

Fixed it, i need to add the following line before:

lgraph=layerGraph(lgraph);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文