salesforce / densecap

BSD 3-Clause "New" or "Revised" License
187 stars 60 forks source link

num_samples should be a positive integer value, but got num_samples=0 #8

Closed existence23 closed 5 years ago

existence23 commented 5 years ago

Every time I ran with the command that: CUDA_VISIBLE_DEVICES=0 python3 scripts/train.py \ --dist_url $dist_url \ --cfgs_file cfgs/yc2.yml \ --checkpoint_path ./checkpoint/yc2-2L-e2e-mask \ --batch_size 14 --world_size 1 \ --cuda \ --enable_visdom \ --sent_weight 0.25 \ --mask_weight 1.0 \ --gated_mask | tee log/yc2-2L-e2e-mask-0

It always show the error that num_samples should be a positive integer value, but got num_samples=0. Here is the log file: Namespace(alpha=0.95, attn_dropout=0.2, batch_size=14, beta=0.999, cap_dropout=0.2, cfgs_file='cfgs/yc2.yml', checkpoint_path='./checkpoint/yc2-2L-e2e-mask', cls_weight=1.0, cuda=True, d_hidden=2048, d_model=1024, dataset='yc2', dataset_file='./data/yc2/yc2_annotations_trainval.json', densecap_references=['./data/yc2/val_yc2.json'], dist_backend='gloo', dist_url=, dur_file='./data/yc2/yc2_duration_frame.csv', enable_visdom=True, epsilon=1e-08, feature_root='/checkpoint/luoweizhou/old_checkpoint02/dat/yc2/rgb_motion_1d', gated_mask=True, grad_norm=1, image_feat_size=3072, in_emb_dropout=0.1, kernel_list=[1, 3, 5, 7, 9, 11, 15, 21, 27, 33, 41, 49, 57, 71, 111, 161], learning_rate=0.1, load_train_samplelist=False, load_valid_samplelist=False, loss_alpha_r=2, losses_log_every=1, mask_weight=1.0, max_epochs=20, max_sentence_len=20, n_heads=8, n_layers=2, neg_thresh=0.3, num_workers=1, optim='sgd', patience_epoch=1, pos_thresh=0.7, reduce_factor=0.5, reg_weight=10, sample_prob=0, sampling_sec=0.5, save_checkpoint_every=1, save_train_samplelist=False, save_valid_samplelist=False, scst_weight=0.0, seed=213, sent_weight=0.25, slide_window_size=480, slide_window_stride=20, start_from='', stride_factor=50, train_data_folder=['training'], train_sample=20, train_samplelist_path='/z/home/luozhou/subsystem/densecap_vid/train_samplelist.pkl', val_data_folder=['validation'], valid_batch_size=64, valid_samplelist_path='/z/home/luozhou/subsystem/densecap_vid/valid_samplelist.pkl', vis_emb_dropout=0.1, world_size=1) Directory already exists. loading dataset number(#) of words in the vocab: 1011 number(#) of sentences in training: 10337, # of sentences in validation: 3492 number(#) of training videos: 1333 size of the sentence block variable (['training']): torch.Size([0]) total number of ['training'] videos: 0 total number of ['training'] samples (unique segments): 0 total number of annotations: 0 total number of missing annotations: 0 avg pos anc: nan avg neg anc: nan

Does any ever meet this problem before? I'm really confused in this step...

LuoweiZhou commented 5 years ago

Hi @existence23, you need to set the paths in the config file to your data/feature directory, as we mentioned here. We will revise the README file to make this more clear.

existence23 commented 5 years ago

Hi @existence23, you need to set the paths in the config file to your data/feature directory, as we mentioned here. We will revise the README file to make this more clear.

Thank you for your quick reply! I'm sorry that I'm still confused. Which paths in the config file should I modify? It seems that the dataset paths point to the yc2 file correctly except the feature_root file. Can I ask what is the feature_root mean? How should I modify the feature_root path?

LuoweiZhou commented 5 years ago

@existence23 you can download the feature files following the instructions here for either YouCook2 or ANet. Place the folder in your preferred location and set the path in the config file accordingly.

existence23 commented 5 years ago

Thank you for your reply! I already download the files. I did not noticed that the featured_root should direct to these files. It helps!