jfzhang95 / pytorch-video-recognition

PyTorch implemented C3D, R3D, R2Plus1D models for video activity recognition.
MIT License
1.18k stars 250 forks source link

C3D training from scratch #12

Open anguszxd opened 5 years ago

anguszxd commented 5 years ago

hi @jfzhang95 , thanks for your code. I'm trying to train C3D model from scratch using your code. I haven't change any setting. After several epoches, the training loss remains to be NaN. What should I do to train C3D model from scratch ? I'm using UCF101 dataset.

rambleramble commented 5 years ago

I encountered the same issue. any suggestion?

cantonioupao commented 5 years ago

Same issue here when i tried to implement the model to the breakfast dataset

jfzhang95 commented 5 years ago

Did you check your PyTorch version? This whole project is based on PyTorch 0.4.0. Also you could reduce the learning rate.

JimReno commented 5 years ago

@rambleramble I do set the learning rate to 1e5 when I do transfer learning on my own data set. please try to reduce the learning rate

NirajDharamshi commented 5 years ago

When training on UCF-101 dataset, I am getting 'ValueError: Range cannot be empty (low >= high) unless no samples are taken'.I didn't change any code. Any idea what could be the issue.

shaofulien commented 5 years ago

When training on UCF-101 dataset, I am getting 'ValueError: Range cannot be empty (low >= high) unless no samples are taken'.I didn't change any code. Any idea what could be the issue.

It happens because some video doesn't have frame more than 16. you can modify the code in the crop func.

 def crop(self, buffer, clip_len, crop_size):
    # randomly select time index for temporal jittering
    if (buffer.shape[0]<=16):
        time_index=0
    else:
        time_index = np.random.randint(buffer.shape[0] - clip_len)
goforfar commented 5 years ago

Hi! I try the code with TITANXp 12Gb, but before it starts training, it reported that "Runtimerror: cuda out of memory". Do your guys meet the same issues? Could anyone give some ideas for me.....Thanks

meisa233 commented 5 years ago

Hi! I try the code with TITANXp 12Gb, but before it starts training, it reported that "Runtimerror: cuda out of memory". Do your guys meet the same issues? Could anyone give some ideas for me.....Thanks

I encountered the same issue. Then I reduced the batch size to 4 and it works. As you can see, it requires a big memory.

mbilalshaikh commented 3 years ago

When training on UCF-101 dataset, I am getting 'ValueError: Range cannot be empty (low >= high) unless no samples are taken'.I didn't change any code. Any idea what could be the issue.

It happens because some video doesn't have frame more than 16. you can modify the code in the crop func.

 def crop(self, buffer, clip_len, crop_size):
    # randomly select time index for temporal jittering
    if (buffer.shape[0]<=16):
        time_index=0
    else:
        time_index = np.random.randint(buffer.shape[0] - clip_len)

I update this way but still receiving the below error.

RuntimeError: stack expects each tensor to be equal size, but got [3, 0, 112, 112] at entry 0 and [3, 16, 112, 112] at entry 2

jacklove233 commented 3 years ago

在 UCF-101 数据集上训练时,我收到“ValueError: Range cannot be empty (low >= high)除非没有采样”。我没有更改任何代码。知道可能是什么问题。

发生这种情况是因为某些视频的帧数不超过 16。您可以在crop func 中修改代码。

 def crop(self, buffer, clip_len, crop_size):
    # randomly select time index for temporal jittering
    if (buffer.shape[0]<=16):
        time_index=0
    else:
        time_index = np.random.randint(buffer.shape[0] - clip_len)

我以这种方式更新,但仍然收到以下错误。

运行时错误:堆栈期望每个张量的大小相等,但在条目 0 处为 [3, 0, 112, 112],在条目 2 处为 [3, 16, 112, 112]

Have you solved this problem now? Can you tell me how to solve it?