megvii-research / CADDM

Official implementation of ID-unaware Deepfake Detection Model
Apache License 2.0
135 stars 19 forks source link

Update adm.py #5

Closed zhangchaosd closed 1 year ago

zhangchaosd commented 1 year ago

Resolve an error on Pytorch 1.13.1 and Pytorch 2.0.

` Traceback (most recent call last): File "/Users/zhangchao/Downloads/CADDM-master/backbones/caddm.py", line 61, in o = model(x) File "/Users/zhangchao/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, kwargs) File "/Users/zhangchao/Downloads/CADDM-master/backbones/caddm.py", line 47, in forward loc, cof, adm_final_feat = self.adm(x) File "/Users/zhangchao/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, *kwargs) File "/Users/zhangchao/Downloads/CADDM-master/backbones/adm.py", line 193, in forward location, confidence = self.multi_scale_detection_module(adm_feats) File "/Users/zhangchao/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(args, kwargs) File "/Users/zhangchao/Downloads/CADDM-master/backbones/adm.py", line 123, in forward location.append(detector(feat).permute(0, 2, 3, 1).contiguous()) File "/Users/zhangchao/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/Users/zhangchao/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 463, in forward return self._conv_forward(input, self.weight, self.bias) File "/Users/zhangchao/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/conv.py", line 459, in _conv_forward return F.conv2d(input, weight, bias, self.stride, TypeError: conv2d() received an invalid combination of arguments - got (Tensor, Parameter, Parameter, tuple, tuple, tuple, int), but expected one of: