File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,10 @@ void keras::LayerConv2D::load_weights(std::ifstream &fin) {
40
40
char tmp_char = ' ' ;
41
41
string tmp_str = " " ;
42
42
float tmp_float;
43
+ bool skip = false ;
43
44
fin >> m_kernels_cnt >> m_depth >> m_rows >> m_cols >> m_border_mode;
45
+ if (m_border_mode == " [" ) { m_border_mode = " valid" ; skip = true ; }
46
+
44
47
cout << " LayerConv2D " << m_kernels_cnt << " x" << m_depth << " x" << m_rows <<
45
48
" x" << m_cols << " border_mode " << m_border_mode << endl;
46
49
// reading kernel weights
@@ -49,7 +52,8 @@ void keras::LayerConv2D::load_weights(std::ifstream &fin) {
49
52
for (int d = 0 ; d < m_depth; ++d) {
50
53
vector<vector<float > > tmp_single_depth;
51
54
for (int r = 0 ; r < m_rows; ++r) {
52
- fin >> tmp_char; // for '['
55
+ if (!skip) { fin >> tmp_char; } // for '['
56
+ else { skip = false ; }
53
57
vector<float > tmp_row;
54
58
for (int c = 0 ; c < m_cols; ++c) {
55
59
fin >> tmp_float;
You can’t perform that action at this time.
0 commit comments