Skip to content

Commit

Permalink
修复打开文件句柄
Browse files Browse the repository at this point in the history
  • Loading branch information
cuixing158 committed Apr 30, 2020
1 parent 18320b5 commit 02a7e1b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/importDarkNetLayers.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@

%% 解析配置cfg文件
fid = fopen(cfgfile,'r');
if fid == -1
error('Author:Function:OpenFile', 'Cannot open file: %s', cfgfile);
end
cfg = textscan(fid, '%s', 'Delimiter',{' '});
fclose(fid);
cfg = cfg{1};
Expand Down
3 changes: 3 additions & 0 deletions utils/importDarknetWeights.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

%% 读取权重参数文件
fid_w = fopen(weightsfile,'rb');
if fid_w == -1
error('Author:Function:OpenFile', 'Cannot open file: %s', weightsfile);
end
header = fread(fid_w, 3, '*int32');
if header(2) > 1
header2 = fread(fid_w, 1, '*int64'); % int64占用8个字节
Expand Down

0 comments on commit 02a7e1b

Please sign in to comment.