Something's wrong with the training code.
hj611 opened this issue · comments
bug1.
SPOT-main/spot_train.py", line 337, in pretrain
ep, tot_loss,feat_loss,loss_clip_order))
UnboundLocalError: local variable 'tot_loss' referenced before assignment
bug2.
File " /SPOT-main/spot_train.py", line 786, in
train_loader = torch.utils.data.DataLoader(spot_dataset.SPOTDataset(subset="train"),
File " /.conda/envs/SPOT/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 270, in init
sampler = RandomSampler(dataset, generator=generator) # type: ignore[arg-type]
File " /.conda/envs/SPOT/lib/python3.9/site-packages/torch/utils/data/sampler.py", line 102, in init
raise ValueError("num_samples should be a positive integer "
ValueError: num_samples should be a positive integer value, but got num_samples=0
I encountered the same problem as you. This code seems hard to run through.
I guess that you directly run this codes with I3D features, In the splot_dataloader.py file, the author utilize the TSN features. You use the TSN features and the codes can be run successfully!