Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
9a982813
Commit
9a982813
authored
Mar 03, 2017
by
Vadim Markovtsev
Browse files
Add protobuf 64MB limit warning
parent
89bccc63
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
swivel/fastprep.cc
swivel/fastprep.cc
+16
-3
No files found.
swivel/fastprep.cc
View file @
9a982813
...
...
@@ -374,12 +374,25 @@ void CoocBuffer::WriteShards() {
munmap
(
coocs
,
nbytes
);
close
(
fds_
[
shard
]);
if
(
sparse_local_row
->
value_size
()
*
8
>=
(
64
<<
20
))
{
std
::
cout
<<
"Warning: you are likely to catch protobuf parsing errors "
"in TF 1.0 and older because the shard is too fat (>= 64MiB); see "
<<
std
::
endl
<<
"kDefaultTotalBytesLimit in src/google/protobuf/io/coded_stream.h "
" changed in protobuf/commit/5a76e633ea9b5adb215e93fdc11e1c0c08b3fc74"
<<
std
::
endl
<<
"https://github.com/tensorflow/tensorflow/issues/7311"
<<
std
::
endl
<<
"Consider increasing the number of shards."
;
}
// Write the protocol buffer as a binary blob to disk.
char
filename
[
256
];
snprintf
(
filename
,
sizeof
(
filename
),
"shard-%03d-%03d.pb"
,
row_shard
,
const
int
filename_max_size
=
4096
;
std
::
unique_ptr
<
char
[]
>
filename
(
new
char
[
filename_max_size
]);
snprintf
(
filename
.
get
(),
filename_max_size
,
"shard-%03d-%03d.pb"
,
row_shard
,
col_shard
);
const
std
::
string
path
=
output_dirname_
+
"/"
+
filename
;
const
std
::
string
path
=
output_dirname_
+
"/"
+
filename
.
get
()
;
int
fd
=
open
(
path
.
c_str
(),
O_WRONLY
|
O_TRUNC
|
O_CREAT
,
0666
);
assert
(
fd
!=
-
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment