yoctta / multiple-attention

The code of multi-attention deepfake detection
241 stars 54 forks source link

meet a problem when running the code #16

Open mowen9 opened 2 years ago

mowen9 commented 2 years ago

Hi, Thank you for sharing the code. I run your code and meet a mistake as follows:

            File "/home/wj/60deepfake/github/multiple-attention-master/models/MAT.py", line 378, in forward
            x=self.pooling(feature_maps)
            ......
            File "/home/wj/anaconda3/envs/video/lib/python3.8/site-packages/torch/nn/functional.py", line 1129, in adaptive_avg_pool2d
            _output_size = _list_with_default(output_size, input.size())
            AttributeError: 'tuple' object has no attribute 'size'

I find that feature_maps is obtained from class 'Texture_Enhance_v2'.

        self.pooling=nn.AdaptiveAvgPool2d(1)
        self.texture_enhance=Texture_Enhance_v2(num_features,1)
        ......
        feature_maps=self.texture_enhance(feature_maps,(0.2,0.2))
        x=self.pooling(feature_maps)

The output of the class 'Texture_Enhance_v2' is a tuple ( "return feature_maps,feature_maps_d" ). The pooling operation can not deal with tuple data.

Can the author help me and solve this problem? Thank you!

MZMMSEC commented 2 years ago

I met the same problem! Have you solved it?

damengdameng commented 2 years ago

I met the same problem! Have you solved it?

This can be solved by changing feature_maps=self.texture_enhance(feature_maps,(0.2,0.2)) to feature_maps, _ =self.texture_enhance(feature_maps,(0.2,0.2))

Olive0407 commented 1 year ago

When will the class netrunc be called? Isn't the network going directly to the forward in MAT.py?