Error using DAGNetwork/layerGraph
2 次查看(过去 30 天)
显示 更早的评论
clear all;
close all;
classdef DAGNetwork.layerGraph
methods
function Igraph = DAGNetwork.layerGraph(this)
% Convert DAGNetwork to layer graph
internalLayerGraph = this.getLayerGraph();
layerMap = this.getLayerMap();
disp(internalLayerGraph);
disp(layerMap);
% Strip the QuantizationInfo from the layers
internalLayers = nnet.internal.cnn.layer.util.resetQuantizationInfo(internalLayerGraph.Layers);
externalLayers = iExternalLayers(internalLayers, layerMap);
Igraph = nnet.cnn.LayerGraph.createFromLayersAndInternalConnections(externalLayers, internalLayerGraph.Connections);
end
end
methods (Static)
% Define any static methods here if needed
end
end
function externalLayers = iExternalLayers(internalLayers, layersMap)
externalLayers = layersMap.externalLayers(internalLayers);
end
Error using DAGNetwork/layerGraph
Error: File: layerGraph.m Line: 5 Column: 48
Dotted names can be used only within a CLASS block.
回答(1 个)
Gayathri
2025-5-12
The error mentioned in the comments is due to the fact that the "layerGraph" MATLAB function is being overrided by your custom function.
This can be verified by running the following command in the Command Window.
which layerGraph -all
The error can be resolved by renaming or removing the custom "layerGraph.m" file from your local folder, so that MATLAB uses its built-in function instead.
It is unclear why a custom function was created for this purpose, but the issue arises because MATLAB does NOT support dotted class names like "DAGNetwork.layerGraph" unless they are defined within a package or as nested classes.
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!