E:\va>python train.py --epochs 3001 --batch_size 32 --checkpoint_path data/save --feats_dir data/feats/resnet152 --model S2VTAttModel --with_c3d 0 --dim_vid 2048
save opt details to data/save\opt_info.json
vocab size is 6019
number of train videos: 3200
number of val videos: 200
number of test videos: 1000
load feats from ['data/feats/resnet152']
max sequence length in data is 28
vocab size is 6019
number of train videos: 3200
number of val videos: 200
number of test videos: 1000
load feats from ['data/feats/resnet152']
max sequence length in data is 28
D:\Python\lib\site-packages\torch\nn\modules\rnn.py:62: UserWarning: dropout option adds dropout after all but last recurrent layer, so non-zero dropout expects num_layers greater than 1, but got dropout=0.5 and num_layers=1
warnings.warn("dropout option adds dropout after all but last "
D:\Python\lib\site-packages\torch\nn_reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='none' instead.
warnings.warn(warning.format(ret))
D:\Python\lib\site-packages\torch\optim\lr_scheduler.py:129: UserWarning: Detected call of lr_scheduler.step()
before optimizer.step()
. In PyTorch 1.1.0 and later, you should call them in the opposite order: optimizer.step()
before lr_scheduler.step()
. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
warnings.warn("Detected call of lr_scheduler.step()
before optimizer.step()
. "
新轮次 0 正在训练……
0%| | 0/100 [00:00<?, ?it/s]D:\Python\lib\site-packages\torch\nn\functional.py:1794: UserWarning: nn.functional.tanh is deprecated. Use torch.tanh instead.
warnings.warn("nn.functional.tanh is deprecated. Use torch.tanh instead.")
100%|████████████████████████████████████████████████████████████████████████████████| 100/100 [00:17<00:00, 5.82it/s]
轮次 0 train_loss = 48.52919979095459
模型保存到 data/save\model_0.pth
100%|████████████████████████████████████████████████████████████████████████████████████| 7/7 [00:00<00:00, 20.43it/s]
轮次 0 val_loss = 42.59846823556082
E:\va\train.py:51: FutureWarning: pandas.io.json.json_normalize is deprecated, use pandas.json_normalize instead
answer_dataframe = json_normalize(
Traceback (most recent call last):
File "E:\va\train.py", line 219, in
main(opt)
File "E:\va\train.py", line 205, in main
train(dataloader_train, dataloader_val, dataset_val, model, crit,
File "E:\va\train.py", line 152, in train
validate(model, utils.LanguageModelCriterion(),
File "E:\va\train.py", line 70, in validate
valid_score = scorer.score(answers, seq_outputs, seq_outputs.keys())
File "E:\va\misc\cocoeval.py", line 85, in score
score, scores = scorer.compute_score(gts, res)
File "E:\va\coco-caption\pycocoevalcap\meteor\meteor.py", line 41, in compute_score
self.meteor_p.stdin.flush()
OSError: [Errno 22] Invalid argument
batch_size 大于1就会出现这个错误,跑不起来