HHTseng / video-classification

Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
940 stars 216 forks source link

Frames of varying length #38

Open abhiray92 opened 4 years ago

abhiray92 commented 4 years ago

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 commented 4 years ago

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

HHTseng commented 4 years ago

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

abhiray92 commented 4 years ago

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

HHTseng commented 4 years ago

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

abhiray92 commented 4 years ago

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

abhiray92 commented 4 years ago

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 commented 3 years ago

@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'
berna-ylmz commented 3 years ago

Did you solve this problem @abhiray92 ?

abhiray92 commented 3 years ago

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

berna-ylmz commented 3 years ago

Thanks @abhiray92