Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code for Darcy Flow does not work #12

Closed
Shancong-Mou opened this issue Dec 21, 2022 · 3 comments
Closed

Code for Darcy Flow does not work #12

Shancong-Mou opened this issue Dec 21, 2022 · 3 comments

Comments

@Shancong-Mou
Copy link

Hi,

Amazing project! I am able to duplicate the Burgers experiment. However, the code for Darcy Flow does not work.

python3 train_operator.py --config_path configs/pretrain/Darcy-pretrain.yaml

with the following error:
Traceback (most recent call last):
File "train_operator.py", line 133, in
train_2d(args, config)
File "train_operator.py", line 90, in train_2d
num=data_config['n_samples'],
KeyError: 'n_samples'

@alabaykazakh
Copy link

Hi,

Amazing project! I am able to duplicate the Burgers experiment. However, the code for Darcy Flow does not work.

python3 train_operator.py --config_path configs/pretrain/Darcy-pretrain.yaml

with the following error: Traceback (most recent call last): File "train_operator.py", line 133, in train_2d(args, config) File "train_operator.py", line 90, in train_2d num=data_config['n_samples'], KeyError: 'n_samples'

write n_samples instead of n_sample in configs/pretrain/Darcy-pretrain.yaml file.

@Shancong-Mou
Copy link
Author

Hi,
Amazing project! I am able to duplicate the Burgers experiment. However, the code for Darcy Flow does not work.
python3 train_operator.py --config_path configs/pretrain/Darcy-pretrain.yaml
with the following error: Traceback (most recent call last): File "train_operator.py", line 133, in train_2d(args, config) File "train_operator.py", line 90, in train_2d num=data_config['n_samples'], KeyError: 'n_samples'

write n_samples instead of n_sample in configs/pretrain/Darcy-pretrain.yaml file.

Thanks for your feedback. I just fix that issue and compiled again, a new error appears:

Traceback (most recent call last):
File "train_operator.py", line 133, in
train_2d(args, config)
File "train_operator.py", line 98, in train_2d
pad_ratio=config['model']['pad_ratio']).to(device)
KeyError: 'pad_ratio'

I am wondering if the author accidentally push the run version of the code?

@devzhk
Copy link
Member

devzhk commented Dec 26, 2022

Hey,

Sorry, my bad. I added a new feature to the FNO architecture (padding) and didn't merge it correctly with the main branch.

I just updated the repo. For Darcy exp, you can run the following to train the operator

python3 train_darcy.py --config configs/operator/Darcy-pretrain.yaml

To test the trained operator on test set, run

python3 train_darcy.py --config configs/operator/Darcy-pretrain.yaml --test --ckpt [path to the checkpoint]

Regards

@devzhk devzhk closed this as completed Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants