I don't understand why there is a problem with data reading.
C:\Users\YA\anaconda3\envs\pytorch\python.exe E:\yc2\progressive-action-prediction-main\train.py
2023-07-13 12:12:02 DESKTOP-R5U0C5C root[14144] INFO CUDA_VISIBLE_DEVICES set to 0
2023-07-13 12:12:02 DESKTOP-R5U0C5C root[14144] INFO Using pytorch version 1.12.1 (['C:\Users\YA\anaconda3\envs\pytorch\lib\site-packages\torch'])
2023-07-13 12:12:02 DESKTOP-R5U0C5C root[14144] INFO Start training with args:
{
"attn_dropout": 0.0,
"backbone": "MTNet_xs",
"batch_size": 16,
"config": null,
"cross_dim_head": 64,
"cross_heads": 1,
"data_dir": "data/UCF-101",
"dataset": "UCF-101",
"end_epoch": 60,
"ff_dropout": 0.0,
"frame_len": 16,
"frame_size": [
224,
224
],
"gpus": [
0
],
"head": "Tempr_h",
"label_dir": "labels/",
"latent_dim": 512,
"latent_dim_head": 64,
"latent_heads": 8,
"log_file": "logs/video_pred_at-DESKTOP-R5U0C5C_datetime_2023-7-13_with_observation_ratio_None_Tempr_h_MTNet_xs_ada.log",
"long_cycles": false,
"lr_base": 0.01,
"lr_factor": 0.1,
"lr_mult": {
"classifier": 1.0,
"head": 0.1,
"pool": 0.1
},
"lr_steps": [
14,
32,
44
],
"max_freq": 10.0,
"model_dir": "./results\observation_ratio_None\Tempr_h_MTNet_xs_ada",
"num_freq_bands": 10,
"num_latents": 256,
"num_samplers": 3,
"optimiser": "AdamW",
"pool": "ada",
"precision": "fp32",
"pretrained_dir": null,
"print_net": false,
"random_seed": 1,
"results_dir": "./results",
"resume_epoch": 0,
"save_frequency": 60,
"short_cycles": false,
"train_frame_interval": [
1,
2,
3,
4
],
"val_frame_interval": [
1,
2
],
"video_per": null,
"video_per_train": 0.4,
"video_per_val": 0.4,
"weight_decay": 1e-05,
"weight_tie_layers": false,
"workers": 0
}
2023-07-13 12:12:02 DESKTOP-R5U0C5C root[14144] INFO CUDA availability: True
2023-07-13 12:12:02 DESKTOP-R5U0C5C root[14144] INFO Preprocessing:: using default mean & std.
2023-07-13 12:12:11 DESKTOP-R5U0C5C root[14144] INFO VideoIter:: - Found: 9537/9536 videos from csv file
2023-07-13 12:12:11 DESKTOP-R5U0C5C root[14144] INFO VideoIter:: Found dict at: labels/dictionary.json
2023-07-13 12:12:11 DESKTOP-R5U0C5C root[14144] INFO VideoIter:: iterator initialized (phase: 'train', num: 9537)
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO VideoIter:: - Found: 3783/3782 videos from csv file
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO VideoIter:: Found dict at: labels/dictionary.json
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO VideoIter:: iterator initialized (phase: 'val', num: 3783)
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO Optimiser:: - classifier lr is set to 1.0e-2 for 4 params
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO Optimiser:: - head lr is set to 1.0e-3 for 81 params
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO Optimiser:: - pool lr is set to 1.0e-3 for 1 params
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO Optimiser:: - base lr is set to 1.0e-02 for 635 params
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO IterScheduler:: Each epoch will have 596 iterations based on batch size 16
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO Iter 0: start with learning rate: 1.00000e-02 (next lr step: 8344)
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO LRScheduler: The learning rate will change at steps: [8344, 19072, 26224]
2023-07-13 12:12:13 DESKTOP-R5U0C5C root[14144] INFO No cycles selected
Traceback (most recent call last):
File "E:\yc2\progressive-action-prediction-main\data\video_iterator.py", line 299, in getitem
frames, label, vid_path = self.getitem_array_from_video(index)
File "E:\yc2\progressive-action-prediction-main\data\video_iterator.py", line 279, in getitem_array_from_video
sampled_frames.append(video.extract_frames(indices=sampled_indices).unsqueeze(0))
File "E:\yc2\progressive-action-prediction-main\data\video_iterator.py", line 88, in extract_frames
frames = self.extract_frames_fast(indices)
File "E:\yc2\progressive-action-prediction-main\data\video_iterator.py", line 124, in extract_frames_fast
t, h, w, _ = frames.shape
ValueError: not enough values to unpack (expected 4, got 1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\yc2\progressive-action-prediction-main\train.py", line 581, in
net.fit(train_iter=train_data,
File "E:\yc2\progressive-action-prediction-main\run\model.py", line 576, in fit
data,target = next(train_loader)
File "C:\Users\YA\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 681, in next
data = self._next_data()
File "C:\Users\YA\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data\dataloader.py", line 721, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\Users\YA\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\YA\anaconda3\envs\pytorch\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\yc2\progressive-action-prediction-main\data\video_iterator.py", line 317, in getitem
index = random.randrange(d_time % self.len())
File "C:\Users\YA\anaconda3\envs\pytorch\lib\random.py", line 306, in randrange
raise ValueError("empty range for randrange()")
ValueError: empty range for randrange()