ltttpku / CMD-SE-release

11 stars 2 forks source link

RuntimeError: stack expects a non-empty TensorList #6

Closed hxqstree closed 1 month ago

hxqstree commented 1 month ago

Hi,thank you for your nice work!

I get the following error:

File "/CMD-SE-release-main/models/model.py", line 621, in text_to_embedding x = torch.stack(all_token_embeddings, dim=0) # [batch_size, n_ctx, d_model] RuntimeError: stack expects a non-empty TensorList

How should this be solved?

ltttpku commented 1 month ago

Hi, what command do you use to run the Python script?

hxqstree commented 1 month ago

I set the hyperparameters as follows: --batch_size 2 \ --output_dir [path to save checkpoint] \ --epochs 80 \ --lr 1e-4 --min-lr 1e-7 \ --hoi_token_length 25 \ --enable_dec \ --dataset_file hico --multi_scale true --f_idxs 5 8 11 --set_cost_hoi_type 5 --use_aux_text true \ --enable_focal_loss --description_file_path hico_hoi_descriptions.json After setting the parameters, I ran "main" directly. And sometimes there is no problem in the first round of training, but this problem will occur in the second round Is it possible that it is due to batch_size?

ltttpku commented 1 month ago

Yes, it is possible that the issue is related to the batch size. Would it be possible to try a larger batch size and see if that helps?

hxqstree commented 1 month ago

Thanks for your help!