pytorch-video-recognition icon indicating copy to clipboard operation
pytorch-video-recognition copied to clipboard

C3D training from scratch

Open anguszxd opened this issue 5 years ago • 10 comments

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.

anguszxd avatar Jan 16 '19 12:01 anguszxd

I encountered the same issue. any suggestion?

rambleramble avatar Jan 23 '19 00:01 rambleramble

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

cantonioupao avatar Feb 19 '19 21:02 cantonioupao

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

jfzhang95 avatar Feb 22 '19 05:02 jfzhang95

@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

JimReno avatar Mar 20 '19 06:03 JimReno

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.

NirajDharamshi avatar Apr 29 '19 04:04 NirajDharamshi

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)

shaofulien avatar Apr 29 '19 05:04 shaofulien

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

goforfar avatar May 06 '19 07:05 goforfar

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.

meisa233 avatar May 12 '19 14:05 meisa233

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

mbilalshaikh avatar Aug 09 '21 14:08 mbilalshaikh

在 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?

jacklove233 avatar Sep 16 '21 10:09 jacklove233