-
Notifications
You must be signed in to change notification settings - Fork 230
【PPSCI Export&Infer No.34】 #1129
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
Conversation
Thanks for your contribution! |
prefix="wind", | ||
) | ||
visualizer_weather.save(cfg.INFER.export_path, vis_dict) | ||
save_path = save_path = f"{cfg.INFER.export_path}/predict.npz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
save_path = save_path = f"{cfg.INFER.export_path}/predict.npz" | |
save_path = osp.join(cfg.INFER.export_path, "predict.npz") |
|
||
# general settings | ||
mode: train # running mode: train/eval | ||
mode: infer # running mode: train/eval |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode: infer # running mode: train/eval | |
mode: train # running mode: train/eval/export/infer |
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# limitations under the License. | |
# limitations under the License. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外请在fourcastnet.md的开头位置,加上模型导出和推理相关命令
好的 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
有几处细节麻烦修改下,没有大问题了
=== "模型导出命令" | ||
|
||
``` sh | ||
# 风速预训练模型导出 | ||
python train_pretrain.py mode==export | ||
# 风速微调模型导出 | ||
python train_finetune.py mode==export | ||
# 降水量模型导出 | ||
python train_precip.py mode==export | ||
``` | ||
|
||
=== "模型推理命令" | ||
|
||
``` sh | ||
# 风速预训练模型推理 | ||
python train_pretrain.py mode==infer | ||
# 风速微调模型推理 | ||
python train_finetune.py mode==infer | ||
# 降水量模型推理 | ||
python train_precip.py mode==infer | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的==
是不对的,需要改为=
docs/zh/examples/fourcastnet.md
Outdated
# 风速预训练模型推理 | ||
python train_pretrain.py mode==infer | ||
# 风速微调模型推理 | ||
python train_finetune.py mode==infer | ||
# 降水量模型推理 | ||
python train_precip.py mode==infer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 风速预训练模型推理 | |
python train_pretrain.py mode==infer | |
# 风速微调模型推理 | |
python train_finetune.py mode==infer | |
# 降水量模型推理 | |
python train_precip.py mode==infer | |
# 下载风速预测小样本数据 | |
wget -nc https://paddle-org.bj.bcebos.com/paddlescience%2Fdatasets%2FFourcastNet%2F2018-04-04_n6_precip.npy -P ./datasets/era5/test/ | |
wget -nc https://paddle-org.bj.bcebos.com/paddlescience%2Fdatasets%2FFourcastNet%2F2018-04-04_n6.npy -P ./datasets/era5/test/ | |
# 风速预训练模型推理 | |
python train_pretrain.py mode=infer | |
# 风速微调模型推理 | |
python train_finetune.py mode=infer | |
# 降水量模型推理 | |
# 下载降水量预测小样本数据 | |
wget -nc https://paddle-org.bj.bcebos.com/paddlescience%2Fdatasets%2FFourcastNet%2F2018-09-08_n32.npy -P ./datasets/era5/test/ | |
python train_precip.py mode=infer |
examples/fourcastnet/train_precip.py
Outdated
xticks=np.linspace(0, 1439, 13), | ||
xticklabels=[str(i) for i in range(360, -1, -30)], | ||
yticks=np.linspace(0, 719, 7), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1439, 719这类magic number建议使用cfg.IMG_W-1之类的变量代替
examples/fourcastnet/train_precip.py
Outdated
|
||
output_keys = tuple(f"output_{i}" for i in range(cfg.INFER.num_timestamps)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output_keys = tuple(f"output_{i}" for i in range(cfg.INFER.num_timestamps)) | |
output_keys = tuple(f"output_{i}" for i in range(cfg.INFER.num_timestamps)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
hi, @mayiru1021
|
PR types
为fourcastnet案例的pretrain.py文件添加export与inference功能
PR changes
添加 export函数,inference函数
Describe
添加 export函数,inference函数,在yaml文件中添加了对应设置,实现了可视化功能。