video-classification icon indicating copy to clipboard operation
video-classification copied to clipboard

Frames of varying length

Open abhiray92 opened this issue 5 years ago • 10 comments

HI @HHTseng , the CRNN model is working fine for me, however, the videos in my dataset has varying frame length, I believe you already have the code for this issue as discussed in the link below . Can you please share the code for the same?

https://github.com/HHTseng/video-classification/issues/5

abhiray92 avatar Nov 18 '20 13:11 abhiray92

Hi @HHTseng can you please share the code for varying frame length? Its very important. Thanks

abhiray92 avatar Nov 19 '20 12:11 abhiray92

yes I had it sometime before, allow me to take a few days to find it

HHTseng avatar Nov 19 '20 12:11 HHTseng

Hi @HHTseng Did you get a chance to check for the code? Thanks

abhiray92 avatar Nov 22 '20 15:11 abhiray92

Please check out the files in the folder ResNetCRNN_varylength and run UCF101_ResNetCRNN_varlen.py. This necessarily takes longer time to load and run. Let me know if there's any bug spotted, thanks!

HHTseng avatar Nov 22 '20 18:11 HHTseng

@HHTseng Thanks a MILLION! I will update you as soon as I check and run the code.

abhiray92 avatar Nov 22 '20 18:11 abhiray92

I got the below error after running the code - PS: I have made a few changes to run the model on grayscale images. The mean and std for the transforms parameter has been set to mean=[0.5], std=[0.225].

KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "C:\Users\abhir\.conda\envs\torch\lib\site-packages\torch\utils\data\_utils\worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "C:\Users\abhir\.conda\envs\torch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\abhir\.conda\envs\torch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "D:\Theses\video-classification\ResNetCRNN_varylength\functions.py", line 51, in __getitem__
    channels = len(self.transform.__dict__['transforms'][2].__dict__['mean'])  # get number of channels from Transformation
KeyError: 'mean'

abhiray92 avatar Nov 23 '20 00:11 abhiray92

@HHTseng I am constantly getting this error -

KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "C:\Users\abhir\.conda\envs\torch\lib\site-packages\torch\utils\data\_utils\worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "C:\Users\abhir\.conda\envs\torch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\abhir\.conda\envs\torch\lib\site-packages\torch\utils\data\_utils\fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "D:\Theses\video-classification\CRNN\functions.py", line 51, in __getitem__
    channels = len(self.transform.__dict__['transforms'][2].__dict__['mean'])  # get number of channels from Transformation
KeyError: 'mean'

abhiray92 avatar Dec 04 '20 22:12 abhiray92

Did you solve this problem @abhiray92 ?

berna-ylmz avatar Dec 28 '20 08:12 berna-ylmz

@Berna-lab Yes, my images were in grayscale, so I just set the value of 'Channel = 1'. And it worked.

abhiray92 avatar Dec 28 '20 12:12 abhiray92

Thanks @abhiray92

berna-ylmz avatar Dec 28 '20 13:12 berna-ylmz