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
ad70b50a
Commit
ad70b50a
authored
8 years ago
by
tgupta6
Browse files
Options
Downloads
Patches
Plain Diff
split val into val_subset and val_rest
parent
b5ad2ae0
No related branches found
Branches containing commit
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
+15
-5
15 additions, 5 deletions
answer_classifier_cached_features/eval.py
constants_vision_gpu_2.py
+3
-1
3 additions, 1 deletion
constants_vision_gpu_2.py
with
18 additions
and
6 deletions
answer_classifier_cached_features/eval.py
+
15
−
5
View file @
ad70b50a
...
...
@@ -38,16 +38,23 @@ def create_initializer(graph, sess, model):
return
initializer
()
def
create_batch_generator
(
mode
):
if
mode
==
'
val
'
:
if
mode
==
'
val
_subset
'
:
vqa_resnet_feat_dir
=
constants
.
vqa_val_resnet_feat_dir
vqa_anno
=
constants
.
vqa_val_anno
num_questions
=
constants
.
num_val_questions
num_questions
=
constants
.
num_val_subset_questions
offset
=
0
elif
mode
==
'
val_rest
'
:
vqa_resnet_feat_dir
=
constants
.
vqa_val_resnet_feat_dir
vqa_anno
=
constants
.
vqa_val_anno
num_questions
=
constants
.
num_val_rest_questions
offset
=
constants
.
num_val_subset_questions
elif
mode
==
'
train
'
:
vqa_resnet_feat_dir
=
constants
.
vqa_train_resnet_feat_dir
vqa_anno
=
constants
.
vqa_train_anno
num_questions
=
constants
.
num_train_questions
offset
=
0
else
:
print
"
mode needs to be one of {
'
train
'
,
'
tes
t
'
,
'
val
'
}, found
"
+
mode
print
"
mode needs to be one of {
'
train
'
,
'
val_subse
t
'
,
'
val
_rest
'
}, found
"
+
mode
data_mgr
=
vqa_data
.
data
(
vqa_resnet_feat_dir
,
...
...
@@ -63,7 +70,7 @@ def create_batch_generator(mode):
constants
.
answer_batch_size
,
num_questions
,
1
,
0
)
offset
)
batch_generator
=
tftools
.
data
.
async_batch_generator
(
data_mgr
,
...
...
@@ -266,7 +273,10 @@ if __name__=='__main__':
training
=
False
)
print
'
Starting a session...
'
sess
=
tf
.
Session
(
graph
=
graph
.
tf_graph
)
config
=
tf
.
ConfigProto
()
config
.
gpu_options
.
allow_growth
=
True
config
.
gpu_options
.
per_process_gpu_memory_fraction
=
0.5
sess
=
tf
.
Session
(
config
=
config
,
graph
=
graph
.
tf_graph
)
print
'
Creating initializer...
'
initializer
=
create_initializer
(
...
...
This diff is collapsed.
Click to expand it.
constants_vision_gpu_2.py
+
3
−
1
View file @
ad70b50a
...
...
@@ -153,7 +153,9 @@ vqa_answer_vocab_json = os.path.join(
# VQA dataset params
num_train_questions
=
248349
num_val_questions
=
10000
#121512
num_val_subset_questions
=
10000
num_val_questions
=
121512
num_val_rest_questions
=
num_val_questions
-
num_val_subset_questions
num_test_questions
=
0
# Answer classifier training params
...
...
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