video_to_sequence icon indicating copy to clipboard operation
video_to_sequence copied to clipboard

ValueError: Cannot feed value of shape (1, 61, 4096) for Tensor u'Placeholder:0', which has shape '(1, 80, 4096)'

Open meteora9479 opened this issue 8 years ago • 5 comments

When I tested the trained model, this error arose.

I think this error occurs when video sequence is shorter than 80. Is there someway to use zero-padding to get the same shape (1, 80, 4096) ?

meteora9479 avatar Aug 03 '16 06:08 meteora9479

It is solved by modifying line 319 and 320

        video_feat = np.load(video_feat_path)[None,...]
        video_mask = np.ones((video_feat.shape[0], video_feat.shape[1]))

to :

        if video_feat.shape[1] == n_frame_step:
            video_mask = np.ones((video_feat.shape[0], video_feat.shape[1]))

        else:
            shape_templete = np.zeros(shape=(1, n_frame_step, 4096), dtype=float )
            shape_templete[:video_feat.shape[0],:video_feat.shape[1],:video_feat.shape[2]] = video_feat
            video_feat = shape_templete
            video_mask = np.ones((video_feat.shape[0], n_frame_step))

meteora9479 avatar Aug 03 '16 10:08 meteora9479

Faced the same problem and the above solution solved it. Cheers :)

TitusTom avatar Oct 06 '16 18:10 TitusTom

Hi, In you forked repositories, how to get train_sents_gt.txt and test_sents_gt.txt, val_sents_gt.txt

bitwangdan avatar Nov 26 '16 08:11 bitwangdan

If i remember correctly it pulled the train and test ground truth from the corpus csv file ( from MSVD). I dont remember manually specifying the train and test set ground truth files.

TitusTom avatar Nov 27 '16 19:11 TitusTom

@meteora9479 Hi, In you forked repositories ,how to get train_sents_gt.txt and test_sents_gt.txt,vali_sents_gt.txt?

bitwangdan avatar Nov 28 '16 01:11 bitwangdan