diff --git a/answer_classifier_cached_features/train.py b/answer_classifier_cached_features/train.py index 03b406832208af20ccca9425a4f612c44906730f..1db0b33e29492b948d8fa9f1a57756d11daaf193 100644 --- a/answer_classifier_cached_features/train.py +++ b/answer_classifier_cached_features/train.py @@ -498,16 +498,20 @@ def create_vgenome_batch_generator(): constants.object_labels_json, constants.attribute_labels_json, constants.regions_json, + constants.genome_train_subset_region_ids, constants.image_size, channels=3, resnet_feat_dim=constants.resnet_feat_dim, mean_image_filename=None) + + num_train_subset_regions = len(data_mgr.region_ids) + print num_train_subset_regions index_generator = tftools.data.random( constants.num_regions_with_labels, - constants.region_num_samples, + num_train_subset_regions, constants.region_num_epochs, - constants.region_offset) + 0) batch_generator = tftools.data.async_batch_generator( data_mgr, @@ -550,7 +554,7 @@ class attach_optimizer(): self.optimizer.add_variables( self.graph.object_attribute_vars + self.graph.word_vec_vars, - learning_rate = 0.1*self.lr) + learning_rate = 1.0*self.lr) self.optimizer.add_variables( diff --git a/constants_crunchy.py b/constants_crunchy.py index 13c0c2321bf9474f6423ab4533c6c17320a388b6..099855102918f545a806a1f3ef10f2ee28cce5d1 100644 --- a/constants_crunchy.py +++ b/constants_crunchy.py @@ -5,7 +5,7 @@ def mkdir_if_not_exists(dir_name): if not os.path.exists(dir_name): os.mkdir(dir_name) -experiment_name = 'object_attribute_classifier_large_images_vqa_split' +experiment_name = 'QA_joint_pretrain_genome_split' # Global output directory (all subexperiments will be saved here) global_output_dir = '/home/tanmay/Code/GenVQA/Exp_Results/VQA' @@ -189,13 +189,13 @@ vqa_answer_vocab_json = os.path.join( # Answer classifier training params answer_batch_size = 50 -answer_num_epochs = 6 +answer_num_epochs = 4 answer_offset = 0 answer_obj_atr_loss_wt = 0.1 answer_regularization_coeff = 1e-5 answer_queue_size = 500 answer_embedding_dim = 600 -answer_lr = 1e-4 +answer_lr = 1e-3 answer_log_every_n_iter = 500 answer_output_dir = os.path.join( global_experiment_dir, @@ -203,9 +203,9 @@ answer_output_dir = os.path.join( mkdir_if_not_exists(answer_output_dir) -pretrained_model = '/home/tanmay/Code/GenVQA/Exp_Results/VisualGenome/' + \ - 'object_attribute_classifier_large_images/' + \ - 'object_attribute_classifiers/model-77500' +pretrained_model = '/home/tanmay/Code/GenVQA/Exp_Results/VQA/' + \ + 'object_attribute_classifier_large_images_vqa_split/' + \ + 'object_attribute_classifiers/model-80000' answer_model = os.path.join( answer_output_dir,