HuiGuanLab / ms-sl

Source code of our MM'22 paper Partially Relevant Video Retrieval
Apache License 2.0
51 stars 7 forks source link

Running error in the code #1

Closed xjtupanda closed 1 year ago

xjtupanda commented 1 year ago

Thanks for sharing the great work! When I was running the training script for the TVR dataset, I met an error message.

  File "method/train.py", line 264, in <module>
    model_dir, eval_split_name, eval_path, debug, model_name = start_training(opt)
  File "method/train.py", line 255, in start_training
    train(model, train_dataset, val_video_dataset, val_text_dataset, opt)
  File "method/train.py", line 155, in train
    train_epoch(model, train_loader, optimizer, opt, epoch_i, training=True)
  File "method/train.py", line 75, in train_epoch
    loss, loss_dict = model(batch['clip_video_features'],batch['frame_video_features'],batch['videos_mask'],
  File "/data/xjtupanda/anaconda3/envs/exp/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/data/xjtupanda/experiments/MM/ms-sl-main/method/model.py", line 88, in forward
    = self.get_pred_from_raw_query(
TypeError: get_pred_from_raw_query() got an unexpected keyword argument 'cross'

It turns out that it's this line that incurs the error. https://github.com/HuiGuanLab/ms-sl/blob/45dbc8953a58730c5c8d7de0ae966a46633467e2/method/model.py#L89 So I removed the argument 'cross' passed to the function, and the code ran fine, would that make any difference?

BTW, there's a similar problem in https://github.com/HuiGuanLab/ms-sl/blob/45dbc8953a58730c5c8d7de0ae966a46633467e2/method/eval.py#L166