I am trying to use a nerual network on a set of data. This is my code:
testfiledir = 'Z:\eee_biophotonics1\Shared\SPOT dataset (Training data)\Testing Images\123 images on 456 network\OCT';
matfiles = dir(fullfile(testfiledir, '*.tif'));
nfiles = length(matfiles);
fid = fopen( fullfile(testfiledir, matfiles(i).name) );
net = load('net_456.mat');
result = semanticseg(fid,net);
filename='Z:\eee_biophotonics1\Shared\SPOT dataset (Training data)\Testing Images\123 images on 456 network\nn segmented';
save(result,'%d',i,'-tif');
However this error comes up:
Error using semanticseg
Expected net to be one of these types:
SeriesNetwork, DAGNetwork, dlnetwork
Instead its type was struct.
Error in semanticseg>iCheckNetwork (line 723)
validateattributes(net, {'SeriesNetwork', 'DAGNetwork', 'dlnetwork'}, ...
Error in semanticseg>iParseInputs (line 416)
iCheckNetwork(net);
Error in semanticseg (line 244)
params = iParseInputs(I, net, varargin{:});
Error in SPOTimageconversion_123_456 (line 12)
result = semanticseg(fid,net); % This segments an image "fid" using the network