Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GenVQA
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vision
GenVQA
Commits
2ed2f60a
Commit
2ed2f60a
authored
8 years ago
by
tgupta6
Browse files
Options
Downloads
Patches
Plain Diff
make ans eval and train compatible with each other (resolved conflict in ans train)
Conflicts: answer_classifier_cached_features/train.py
parent
89f48388
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
answer_classifier_cached_features/eval.py
+5
-1
5 additions, 1 deletion
answer_classifier_cached_features/eval.py
answer_classifier_cached_features/train.py
+19
-18
19 additions, 18 deletions
answer_classifier_cached_features/train.py
with
24 additions
and
19 deletions
answer_classifier_cached_features/eval.py
+
5
−
1
View file @
2ed2f60a
...
...
@@ -51,6 +51,8 @@ def create_batch_generator(mode):
qids_json
,
constants
.
vocab_json
,
constants
.
vqa_answer_vocab_json
,
constants
.
object_labels_json
,
constants
.
attribute_labels_json
,
constants
.
image_size
,
constants
.
num_region_proposals
,
constants
.
num_negative_answers
,
...
...
@@ -267,13 +269,15 @@ if __name__=='__main__':
0
,
0
,
constants
.
answer_obj_atr_loss_wt
,
constants
.
answer_ans_loss_wt
,
constants
.
answer_mil_loss_wt
,
resnet_feat_dim
=
constants
.
resnet_feat_dim
,
training
=
False
)
print
'
Starting a session...
'
config
=
tf
.
ConfigProto
()
config
.
gpu_options
.
allow_growth
=
True
config
.
gpu_options
.
per_process_gpu_memory_fraction
=
0.
5
config
.
gpu_options
.
per_process_gpu_memory_fraction
=
0.
9
sess
=
tf
.
Session
(
config
=
config
,
graph
=
graph
.
tf_graph
)
print
'
Creating initializer...
'
...
...
This diff is collapsed.
Click to expand it.
answer_classifier_cached_features/train.py
+
19
−
18
View file @
2ed2f60a
...
...
@@ -484,23 +484,24 @@ class graph_creator():
[
"
accuracy_answer
"
],
self
.
moving_average_accuracy
)
# object
self
.
object_accuracy
=
self
.
add_object_accuracy_computation
(
self
.
object_scores_with_labels
,
self
.
plh
[
'
object_labels
'
])
object_accuracy_summary
=
tf
.
scalar_summary
(
"
accuracy_object
"
,
self
.
object_accuracy
)
# attributes
self
.
attribute_accuracy
=
self
.
add_attribute_accuracy_computation
(
self
.
attribute_scores_with_labels
,
self
.
plh
[
'
attribute_labels
'
])
attribute_accuracy_summary
=
tf
.
scalar_summary
(
"
accuracy_attribute
"
,
self
.
attribute_accuracy
)
if
self
.
training
:
# object
self
.
object_accuracy
=
self
.
add_object_accuracy_computation
(
self
.
object_scores_with_labels
,
self
.
plh
[
'
object_labels
'
])
object_accuracy_summary
=
tf
.
scalar_summary
(
"
accuracy_object
"
,
self
.
object_accuracy
)
# attributes
self
.
attribute_accuracy
=
self
.
add_attribute_accuracy_computation
(
self
.
attribute_scores_with_labels
,
self
.
plh
[
'
attribute_labels
'
])
attribute_accuracy_summary
=
tf
.
scalar_summary
(
"
accuracy_attribute
"
,
self
.
attribute_accuracy
)
def
add_answer_accuracy_computation
(
self
,
scores
):
with
tf
.
variable_scope
(
'
answer_accuracy
'
):
...
...
@@ -896,7 +897,7 @@ def train(
logger
.
log
(
iter
,
False
,
eval_vars_dict
)
iter
+=
1
if
iter
%
8000
==
0
:
if
iter
%
8000
==
0
and
iter
!=
0
:
gc
.
collect
()
logger
.
log
(
iter
-
1
,
True
,
eval_vars_dict
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment