|
11 | 11 | === "模型训练命令"
|
12 | 12 |
|
13 | 13 | ``` sh
|
| 14 | + # Download possion_64 data and model into `examples/data_efficient_nopt/data` |
14 | 15 | cd examples/data_efficient_nopt
|
15 |
| - # Download possion_64 data from https://drive.google.com/drive/folders/1crIsTZGxZULWhrXkwGDiWF33W6RHxJkf |
16 |
| - # Download helmholtz_64 data from https://drive.google.com/drive/folders/1UjIaF6FsjmN_xlGGSUX-1K2V3EF2Zalw |
17 |
| - |
18 |
| - # Update the file paths in `cexamples/data_efficient_nopt/config/data_efficient_nopt.yaml`, specify to mode in `train`, and then specify to `train_path`, `val_path`, `test_path`, `scales_path` and `train_rand_idx_path` |
19 |
| - |
20 |
| - # pretrain or finetune, for possion_64 or helmholtz_64. |
21 |
| - # specify config_name to fno_possion using `data_efficient_nopt_fno_poisson`, or to fno_helmholtz using `data_efficient_nopt_fno_helmholtz` |
22 |
| - python data_efficient_nopt.py --config-name=<config_name> |
| 16 | + mkdir data && cd data |
| 17 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e1_20_train.h5 |
| 18 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e1_20_val.h5 |
| 19 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e1_20_test.h5 |
| 20 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e1_20_train_scale.npy |
| 21 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e5_15_train.h5 |
| 22 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e5_15_train_scale.npy |
| 23 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e5_15_val.h5 |
| 24 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/poisson_64_e5_15_test.h5 |
| 25 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/train_rand_idx.npy |
| 26 | + |
| 27 | + |
| 28 | + # pretrain |
| 29 | + cd examples/data_efficient_nopt |
| 30 | + python data_efficient_nopt.py \ |
| 31 | + --config-name data_efficient_nopt_fno_poisson \ |
| 32 | + config=pois-64-pretrain-e1_20_m0 |
| 33 | + |
| 34 | + # finetune |
| 35 | + python data_efficient_nopt.py \ |
| 36 | + --config-name data_efficient_nopt_fno_poisson \ |
| 37 | + mode=finetune \ |
| 38 | + config=pois_64_finetune_e5_15 \ |
| 39 | + train_config.pois_64_finetune_e5_15.pretrained_ckpt_path="./data/pretrain_b01_m0.pdparams" |
23 | 40 | ```
|
24 | 41 |
|
25 | 42 | === "模型评估命令"
|
|
34 | 51 |
|
35 | 52 | ``` sh
|
36 | 53 | cd examples/data_efficient_nopt
|
37 |
| - # Update the file paths in `cexamples/data_efficient_nopt/config/data_efficient_nopt.yaml`, specify to mode in `infer`, and then specify to `ckpt_path`, `train_path`, `test_path` and `scales_path` |
38 |
| - # Use a fine-tuned model as the checkpoint in 'exp' or utilize `model_convert.py` to convert the official checkpoint. |
39 |
| - |
40 |
| - # use your onw finetune checkpoints, or download checkpoint from [FNO-Poisson](https://drive.google.com/drive/folders/1ekmXqqvpaY6pNStTciw1SCAzF0gjFP_V) or [FNO-Helmholtz](https://drive.google.com/drive/folders/1k7US8ZAgB14Wj9bfdgO_Cjw6hOrG6UaZ) and then convert to paddlepaddle weights. |
41 |
| - python model_convert.py --pt-model <pt_checkpiont> --pd-model <pd_checkpiont> |
| 54 | + mkdir data && cd data |
| 55 | + wget https://dataset.bj.bcebos.com/PaddleScience/data_efficient_nopt/possion_data/finetune_b01_m0_n8192.pdparams |
42 | 56 |
|
43 |
| - # inference for possion_64 or helmholtz_64, specify in config as following: |
44 |
| - # ckpt_path: <ckpt_path> |
45 |
| - # specify config_name to fno_possion using `data_efficient_nopt_fno_poisson`, or to fno_helmholtz using `data_efficient_nopt_fno_helmholtz` |
46 |
| - python data_efficient_nopt.py --config-name=<config_name> |
| 57 | + python data_efficient_nopt.py \ |
| 58 | + --config-name=data_efficient_nopt_fno_poisson.yaml \ |
| 59 | + mode=infer \ |
| 60 | + infer_config.ckpt_path=./exp/pois_64_finetune_e5_15/r0/training_checkpoints/ckpt.tar |
47 | 61 | ```
|
48 | 62 |
|
49 | 63 | ## 1. 背景简介
|
|
0 commit comments