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
6b9d5fba
Unverified
Commit
6b9d5fba
authored
Jan 24, 2018
by
Toby Boyd
Committed by
GitHub
Jan 24, 2018
Browse files
Merge branch 'master' into patch-1
parents
5fd687c5
5fa2a4e6
Changes
147
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
29 additions
and
15 deletions
+29
-15
research/slim/datasets/preprocess_imagenet_validation_data.py
...arch/slim/datasets/preprocess_imagenet_validation_data.py
+1
-0
research/slim/datasets/process_bounding_boxes.py
research/slim/datasets/process_bounding_boxes.py
+1
-0
research/slim/nets/cyclegan.py
research/slim/nets/cyclegan.py
+1
-1
research/slim/nets/dcgan.py
research/slim/nets/dcgan.py
+1
-0
research/slim/nets/dcgan_test.py
research/slim/nets/dcgan_test.py
+1
-0
research/street/python/decoder.py
research/street/python/decoder.py
+1
-0
research/street/python/shapes.py
research/street/python/shapes.py
+1
-0
research/street/python/vgsl_model.py
research/street/python/vgsl_model.py
+3
-1
research/street/python/vgslspecs.py
research/street/python/vgslspecs.py
+1
-0
research/swivel/prep.py
research/swivel/prep.py
+3
-2
research/swivel/text2bin.py
research/swivel/text2bin.py
+1
-1
research/syntaxnet/dragnn/python/dragnn_model_saver_lib_test.py
...ch/syntaxnet/dragnn/python/dragnn_model_saver_lib_test.py
+1
-1
research/syntaxnet/dragnn/python/graph_builder.py
research/syntaxnet/dragnn/python/graph_builder.py
+1
-1
research/syntaxnet/dragnn/python/graph_builder_test.py
research/syntaxnet/dragnn/python/graph_builder_test.py
+2
-1
research/syntaxnet/dragnn/python/network_units.py
research/syntaxnet/dragnn/python/network_units.py
+1
-0
research/syntaxnet/dragnn/python/spec_builder.py
research/syntaxnet/dragnn/python/spec_builder.py
+1
-0
research/syntaxnet/dragnn/python/trainer_lib.py
research/syntaxnet/dragnn/python/trainer_lib.py
+1
-0
research/syntaxnet/syntaxnet/conll2tree.py
research/syntaxnet/syntaxnet/conll2tree.py
+3
-3
research/syntaxnet/syntaxnet/lexicon_builder_test.py
research/syntaxnet/syntaxnet/lexicon_builder_test.py
+2
-2
research/tcn/alignment.py
research/tcn/alignment.py
+2
-2
No files found.
research/slim/datasets/preprocess_imagenet_validation_data.py
View file @
6b9d5fba
...
...
@@ -51,6 +51,7 @@ from __future__ import print_function
import
os
import
os.path
import
sys
from
six.moves
import
xrange
if
__name__
==
'__main__'
:
...
...
research/slim/datasets/process_bounding_boxes.py
View file @
6b9d5fba
...
...
@@ -85,6 +85,7 @@ import glob
import
os.path
import
sys
import
xml.etree.ElementTree
as
ET
from
six.moves
import
xrange
class
BoundingBox
(
object
):
...
...
research/slim/nets/cyclegan.py
View file @
6b9d5fba
...
...
@@ -18,7 +18,7 @@ from __future__ import division
from
__future__
import
print_function
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
layers
=
tf
.
contrib
.
layers
...
...
research/slim/nets/dcgan.py
View file @
6b9d5fba
...
...
@@ -19,6 +19,7 @@ from __future__ import print_function
from
math
import
log
from
six.moves
import
xrange
import
tensorflow
as
tf
slim
=
tf
.
contrib
.
slim
...
...
research/slim/nets/dcgan_test.py
View file @
6b9d5fba
...
...
@@ -18,6 +18,7 @@ from __future__ import absolute_import
from
__future__
import
division
from
__future__
import
print_function
from
six.moves
import
xrange
import
tensorflow
as
tf
from
nets
import
dcgan
...
...
research/street/python/decoder.py
View file @
6b9d5fba
...
...
@@ -25,6 +25,7 @@ import collections
import
re
import
errorcounter
as
ec
from
six.moves
import
xrange
import
tensorflow
as
tf
# Named tuple Part describes a part of a multi (1 or more) part code that
...
...
research/street/python/shapes.py
View file @
6b9d5fba
...
...
@@ -24,6 +24,7 @@ tensor_dim: gets a shape dimension as a constant integer if known otherwise a
runtime usable tensor value.
tensor_shape: returns the full shape of a tensor as the tensor_dim.
"""
from
six.moves
import
xrange
import
tensorflow
as
tf
...
...
research/street/python/vgsl_model.py
View file @
6b9d5fba
...
...
@@ -14,6 +14,8 @@
# ==============================================================================
"""String network description language to define network layouts."""
from
__future__
import
print_function
import
re
import
time
...
...
@@ -170,7 +172,7 @@ def Eval(train_dir,
_AddRateToSummary
(
'Sequence error rate'
,
rates
.
sequence_error
,
step
,
sw
)
sw
.
flush
()
print
'Error rates='
,
rates
print
(
'Error rates='
,
rates
)
else
:
raise
ValueError
(
'Non-softmax decoder evaluation not implemented!'
)
if
eval_interval_secs
:
...
...
research/street/python/vgslspecs.py
View file @
6b9d5fba
...
...
@@ -23,6 +23,7 @@ from string import maketrans
import
nn_ops
import
shapes
from
six.moves
import
xrange
import
tensorflow
as
tf
import
tensorflow.contrib.slim
as
slim
...
...
research/swivel/prep.py
View file @
6b9d5fba
...
...
@@ -61,6 +61,7 @@ import os
import
struct
import
sys
from
six.moves
import
xrange
import
tensorflow
as
tf
flags
=
tf
.
app
.
flags
...
...
@@ -118,7 +119,7 @@ def create_vocabulary(lines):
if
not
num_words
:
raise
Exception
(
'empty vocabulary'
)
print
'vocabulary contains %d tokens'
%
num_words
print
(
'vocabulary contains %d tokens'
%
num_words
)
vocab
=
vocab
[:
num_words
]
return
[
tok
for
tok
,
n
in
vocab
]
...
...
@@ -309,7 +310,7 @@ def main(_):
write_vocab_and_sums
(
vocab
,
sums
,
'row_vocab.txt'
,
'row_sums.txt'
)
write_vocab_and_sums
(
vocab
,
sums
,
'col_vocab.txt'
,
'col_sums.txt'
)
print
'done!'
print
(
'done!'
)
if
__name__
==
'__main__'
:
...
...
research/swivel/text2bin.py
View file @
6b9d5fba
...
...
@@ -49,7 +49,7 @@ import sys
try
:
opts
,
args
=
getopt
(
sys
.
argv
[
1
:],
'o:v:'
,
[
'output='
,
'vocab='
])
except
GetoptError
,
e
:
except
GetoptError
as
e
:
print
>>
sys
.
stderr
,
e
sys
.
exit
(
2
)
...
...
research/syntaxnet/dragnn/python/dragnn_model_saver_lib_test.py
View file @
6b9d5fba
...
...
@@ -45,7 +45,7 @@ class DragnnModelSaverLibTest(test_util.TensorFlowTestCase):
master_spec
=
spec_pb2
.
MasterSpec
()
root_dir
=
os
.
path
.
join
(
FLAGS
.
test_srcdir
,
'dragnn/python'
)
with
file
(
os
.
path
.
join
(
root_dir
,
'testdata'
,
spec_path
),
'r'
)
as
fin
:
with
open
(
os
.
path
.
join
(
root_dir
,
'testdata'
,
spec_path
),
'r'
)
as
fin
:
text_format
.
Parse
(
fin
.
read
().
replace
(
'TOPDIR'
,
root_dir
),
master_spec
)
return
master_spec
...
...
research/syntaxnet/dragnn/python/graph_builder.py
View file @
6b9d5fba
...
...
@@ -28,7 +28,7 @@ from syntaxnet.util import check
try
:
tf
.
NotDifferentiable
(
'ExtractFixedFeatures'
)
except
KeyError
,
e
:
except
KeyError
as
e
:
logging
.
info
(
str
(
e
))
...
...
research/syntaxnet/dragnn/python/graph_builder_test.py
View file @
6b9d5fba
...
...
@@ -20,6 +20,7 @@ import os.path
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
from
google.protobuf
import
text_format
...
...
@@ -245,7 +246,7 @@ class GraphBuilderTest(test_util.TensorFlowTestCase):
master_spec
=
spec_pb2
.
MasterSpec
()
testdata
=
os
.
path
.
join
(
FLAGS
.
test_srcdir
,
'dragnn/core/testdata'
)
with
file
(
os
.
path
.
join
(
testdata
,
spec_path
),
'r'
)
as
fin
:
with
open
(
os
.
path
.
join
(
testdata
,
spec_path
),
'r'
)
as
fin
:
text_format
.
Parse
(
fin
.
read
().
replace
(
'TESTDATA'
,
testdata
),
master_spec
)
return
master_spec
...
...
research/syntaxnet/dragnn/python/network_units.py
View file @
6b9d5fba
...
...
@@ -22,6 +22,7 @@ import abc
import
numpy
as
np
from
six.moves
import
xrange
import
tensorflow
as
tf
from
tensorflow.python.ops
import
nn
from
tensorflow.python.ops
import
tensor_array_ops
as
ta
...
...
research/syntaxnet/dragnn/python/spec_builder.py
View file @
6b9d5fba
...
...
@@ -15,6 +15,7 @@
"""Utils for building DRAGNN specs."""
from
six.moves
import
xrange
import
tensorflow
as
tf
from
dragnn.protos
import
spec_pb2
...
...
research/syntaxnet/dragnn/python/trainer_lib.py
View file @
6b9d5fba
...
...
@@ -23,6 +23,7 @@ import random
import
tensorflow
as
tf
from
six.moves
import
xrange
from
tensorflow.core.framework.summary_pb2
import
Summary
from
tensorflow.python.framework
import
errors
from
tensorflow.python.platform
import
gfile
...
...
research/syntaxnet/syntaxnet/conll2tree.py
View file @
6b9d5fba
...
...
@@ -88,12 +88,12 @@ def main(unused_argv):
sentence
.
ParseFromString
(
d
)
tr
=
asciitree
.
LeftAligned
()
d
=
to_dict
(
sentence
)
print
'Input: %s'
%
sentence
.
text
print
'Parse:'
print
(
'Input: %s'
%
sentence
.
text
)
print
(
'Parse:'
)
tr_str
=
tr
(
d
)
pat
=
re
.
compile
(
r
'\s*@\d+$'
)
for
tr_ln
in
tr_str
.
splitlines
():
print
pat
.
sub
(
''
,
tr_ln
)
print
(
pat
.
sub
(
''
,
tr_ln
)
)
if
finished
:
break
...
...
research/syntaxnet/syntaxnet/lexicon_builder_test.py
View file @
6b9d5fba
...
...
@@ -140,7 +140,7 @@ class LexiconBuilderTest(test_util.TensorFlowTestCase):
self
.
assertTrue
(
last
)
def
ValidateTagToCategoryMap
(
self
):
with
file
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
'tag-to-category'
),
'r'
)
as
f
:
with
open
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
'tag-to-category'
),
'r'
)
as
f
:
entries
=
[
line
.
strip
().
split
(
'
\t
'
)
for
line
in
f
.
readlines
()]
for
tag
,
category
in
entries
:
self
.
assertIn
(
tag
,
TAGS
)
...
...
@@ -148,7 +148,7 @@ class LexiconBuilderTest(test_util.TensorFlowTestCase):
def
LoadMap
(
self
,
map_name
):
loaded_map
=
{}
with
file
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
map_name
),
'r'
)
as
f
:
with
open
(
os
.
path
.
join
(
FLAGS
.
test_tmpdir
,
map_name
),
'r'
)
as
f
:
for
line
in
f
:
entries
=
line
.
strip
().
split
(
' '
)
if
len
(
entries
)
>=
2
:
...
...
research/tcn/alignment.py
View file @
6b9d5fba
...
...
@@ -76,9 +76,9 @@ def compute_average_alignment(
alignment
=
np
.
mean
(
np
.
abs
(
np
.
array
(
times_i
)
-
np
.
array
(
times_j
))
/
float
(
seq_len
))
all_alignments
.
append
(
alignment
)
print
'alignment so far %f'
%
alignment
print
(
'alignment so far %f'
%
alignment
)
average_alignment
=
np
.
mean
(
all_alignments
)
print
'Average alignment %f'
%
average_alignment
print
(
'Average alignment %f'
%
average_alignment
)
summ
=
tf
.
Summary
(
value
=
[
tf
.
Summary
.
Value
(
tag
=
'validation/alignment'
,
simple_value
=
average_alignment
)])
summary_writer
.
add_summary
(
summ
,
int
(
training_step
))
...
...
Prev
1
2
3
4
5
6
7
8
Next
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