pytorch-coviar icon indicating copy to clipboard operation
pytorch-coviar copied to clipboard

Training Error

Open tzzcl opened this issue 6 years ago • 8 comments

Hi,

I tried your code to reproduce the coviar result in your paper.

I followed all your instructions in GET_START.md But I met this error: v_frame_idx = random.randint(seg_begin,seg_end - 1) ... ValueError: empty range for randrange() (1,0,-1)

It seems there is something wrong with the video processing.

Can you give me some hints?

tzzcl avatar Jun 15 '18 14:06 tzzcl

It looks like it's due to a short or 0 "num_frames". With UCF-101 or HMDB this shouldn't happen. Did you follow the same FFmpeg version, and use ./reencode.sh to encode the videos?

Thanks!

chaoyuaw avatar Jun 16 '18 18:06 chaoyuaw

Thanks for your reply!

I just use the same FFmpeg version.

But I find that the format is rawvideo in the ./reencode.sh.

and the decoder flag is AV_CODEC_ID_MPEG4 in coviar_data_loader.c

when I change it to AV_CODEC_ID_RAWVIDEO, it seems works for count frames, but with errors when extracting the frames.

tzzcl avatar Jun 16 '18 18:06 tzzcl

I did intend to use mpeg4 "raw" videos. Namely, videos obtained with the following command ffmpeg -i input.mp4 -c:v -c:v mpeg4 -f rawvideo output.mp4

Can you please use, e.g. ffprobe, to get more information about your encoded videos?

chaoyuaw avatar Jun 16 '18 20:06 chaoyuaw

Here's the output of ffprobe (with user installed git version):

zhangcl2@lamda6-GPU4:/data/zhangcl2/UCF-101-mpeg/ApplyEyeMakeup$ /data/zhangcl2/ffmpeg/bin/ffprobe v_ApplyEyeMakeup_g01_c01.mp4 
ffprobe version N-90418-g74c6a6d Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --prefix=/data/zhangcl2/ffmpeg --enable-pic --disable-yasm --enable-shared
  libavutil      56. 11.100 / 56. 11.100
  libavcodec     58. 15.100 / 58. 15.100
  libavformat    58. 10.100 / 58. 10.100
  libavdevice    58.  2.100 / 58.  2.100
  libavfilter     7. 13.100 /  7. 13.100
  libswscale      5.  0.102 /  5.  0.102
  libswresample   3.  0.101 /  3.  0.101
Input #0, m4v, from 'v_ApplyEyeMakeup_g01_c01.mp4':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 340x256 [SAR 1:1 DAR 85:64], 25 tbr, 1200k tbn, 25 tbc

you can see that the duration is 0s.

tzzcl avatar Jun 17 '18 04:06 tzzcl

Thanks for the information. Yes, it looks like the issue is the failure of encoding. If this specific version of FFmpeg doesn't work in your environment for some reason, maybe you can considering trying any other FFmpeg version that works in your environment. My understanding is that as long as they're "raw mpeg4" videos, the decoder should work fine.

chaoyuaw avatar Jun 18 '18 06:06 chaoyuaw

Dear friend, I have faced the same problem as you. "Decoding video failed" and "Could not allocate video parser context". I wonder if you have solved those two problems. Could you just give me some help? Thank you very much. qq 20190114221301

kinglong1 avatar Jan 14 '19 14:01 kinglong1

Having the same problem

filipetrocadoferreira avatar Jan 21 '19 10:01 filipetrocadoferreira

To who have the same problem with me, I use these strategies:

  1. Change code to pCodec = avcodec_find_decoder(AV_CODEC_ID_RAWVIDEO); from // pCodec = avcodec_find_decoder(AV_CODEC_ID_H264);
  2. Change reencode.sh /data/zhangcl2/ffmpeg/bin/ffmpeg -i ${inname} -vf scale=340:256,setsar=1:1 -q:v 1 -c:v mpeg4 -f rawvideo ${outname} from #/data/zhangcl2/ffmpeg/bin/ffmpeg -i ${inname} -vf scale=340:256,setsar=1:1 -q:v 1 -c:v mpeg4 ${outname}

Hope this may help!

tzzcl avatar Feb 04 '19 11:02 tzzcl