scaomath / galerkin-transformer

[NeurIPS 2021] Galerkin Transformer: a linear attention without softmax for Partial Differential Equations
MIT License
214 stars 28 forks source link

一些代码上的问题 #5

Closed qxj233333 closed 2 years ago

qxj233333 commented 2 years ago

您好: 最近拜读了您的文章《Choose a Transformer: Fourier or Galerkin》,个人感觉这是一个有意义的工作,所以尝试复现这篇论文,但遇到一些代码上的问题。想请教一下解决方案。万分感谢!

qxj233333 commented 2 years ago

Please install Plotly for showing mesh and solutions.

The following code snippets have been run.

os.environ['PYTHONHASHSEED'] = str(1127802)
numpy.random.seed(1127802)
torch.manual_seed(1127802)
torch.cuda.manual_seed(1127802)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
if torch.cuda.is_available():
    torch.cuda.manual_seed_all(1127802)

================================================== Loading piececonst_r421_N1024_smooth1.mat: start at 1646228044.79; LOCAL RAM USAGE AT START: 0.36 GB Please download the dataset from https://github.com/zongyi-li/fourier_neural_operator and put untar them in the data folder. Loading piececonst_r421_N1024_smooth1.mat: done at 1646228044.79 (0.000157 secs elapsed); LOCAL RAM USAGE AT END: 0.36GB (+0.00GB)

Traceback (most recent call last): File "ex2_darcy.py", line 168, in main() File "ex2_darcy.py", line 18, in main train_dataset = DarcyDataset(data_path=train_path, File "/root/libs/ft.py", line 492, in init self._initialize() File "/root/libs/ft.py", line 509, in _initialize data_len = self.get_data_len(len(a)) UnboundLocalError: local variable 'a' referenced before assignment root@container-ae89119dae-b8fc6755:~#

scaomath commented 2 years ago

Data用的是Caltech group的,你要先去下载个数据:https://github.com/zongyi-li/fourier_neural_operator

qxj233333 commented 2 years ago

您好 我近期有复现过FNO 对应的代码和数据集也有下载到相应位置 但还是有出现之前提到的问题