plai-group / flexible-video-diffusion-modeling

MIT License
109 stars 14 forks source link

about fvd #9

Open yuyuyuyuyuty opened 1 month ago

yuyuyuyuyuty commented 1 month ago

Hi , I tried to use your provided code to calculate FVD, but I encountered an error. Could you please help me understand what might be causing it? Traceback (most recent call last): File "/home/huxuemin/huangtingyu/fddpm/scripts/video_fvd.py", line 121, in fvd = compute_fvd(test_dataset, sample_dataset, T=model_args.T, num_videos=args.num_videos, batch_size=args.batch_size) File "/home/huxuemin/huangtingyu/fddpm/scripts/video_fvd.py", line 68, in compute_fvd fvd_handler = FVD(batch_size=int(batch_size), T=T, frame_shape=[H, W, C]) File "/home/huxuemin/huangtingyu/fddpm/scripts/video_fvd.py", line 40, in init self.vid_feature_vec = fvd.create_id3_embedding(fvd.preprocess(self.vid, (224, 224)), batch_size=self.batch_size) File "/home/huxuemin/huangtingyu/fddpm/improved_diffusion/frechet_video_distance.py", line 112, in create_id3_embedding tf.assert_equal( File "/home/huxuemin/miniconda3/envs/hty/lib/python3.10/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler raise e.with_traceback(filtered_tb) from None File "/home/huxuemin/miniconda3/envs/hty/lib/python3.10/site-packages/tensorflow/python/framework/tensor_util.py", line 400, in _AssertCompatible raise TypeError(f"Expected {dtype.name}, but got {mismatch} of type " TypeError: Expected int32, but got invalid frame batch size: of type 'str'.

yuyuyuyuyuty commented 1 month ago

I used the command in the readme:To run scripts/video_fvd.py, tensorflow and tensorflow_hub are required. Install with e.g. pip install tensorflow==2.8 tensorflow_hub==0.12.0, but I got an error i3d_model = hub.Module(hub.resolve(module_spec), name=module_name) AttributeError: module 'tensorflow_hub' has no attribute 'Module'. After I looked it up, I found that the reason was because the version was too high. Did you make any changes later?