I think I found a bug when running the pretrain.py script. I downloaded the pretrain-tv dataset with bash scripts/download_tv_pretrain.sh /path/to/storage, and ran the pretrain.py script in docker. The only changes in the config file are smaller batch sizes. After 500 steps, the program does validation and runs into len() of a 0-d tensor when running validate_vsm.
The error is caused due to one of the input features has the shape torch.Size([1, 60, 768]), which caused loss_neg_ctx to be a scalar value, which makes len() complain. The simple fix that works for me is to add an inline if to detect if it's 0 dimensional and return 1 if it is. An alternative might be to force the scalar into a 1-d vector of 1 value, but I have not tested this solution.
I think I found a bug when running the
pretrain.py
script. I downloaded the pretrain-tv dataset withbash scripts/download_tv_pretrain.sh /path/to/storage
, and ran thepretrain.py
script in docker. The only changes in the config file are smaller batch sizes. After 500 steps, the program does validation and runs intolen() of a 0-d tensor
when runningvalidate_vsm
.The error is caused due to one of the input features has the shape
torch.Size([1, 60, 768])
, which causedloss_neg_ctx
to be a scalar value, which makeslen()
complain. The simple fix that works for me is to add an inline if to detect if it's 0 dimensional and return 1 if it is. An alternative might be to force the scalar into a 1-d vector of 1 value, but I have not tested this solution.Happy to open a PR if needed.