raoyongming / HorNet

[NeurIPS 2022] HorNet: Efficient High-Order Spatial Interactions with Recursive Gated Convolutions

Home Page:https://hornet.ivg-research.xyz/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AttributeError: module 'torch.fft' has no attribute 'rfft2'

1648027181 opened this issue · comments

x2 = torch.fft.rfft2(x2, dim=(2, 3), norm='ortho')
AttributeError: module 'torch.fft' has no attribute 'rfft2'

Hi @1648027181, thanks for your interest in our work. To use torch.fft.rfft2, you need to upgrade PyTorch to 1.8 or a later version. Besides, it is necessary to import both torch and torch.fft like

HorNet/hornet.py

Lines 2 to 7 in d3ae1bb

import torch
import torch.nn as nn
import torch.nn.functional as F
from timm.models.layers import trunc_normal_, DropPath
from timm.models.registry import register_model
import torch.fft
.