CoolFace
Modelpublic

OneScience-Group/Pangu_Weather

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes33downloads
README.md141 linesDownload Raw Back to root
1---2license: apache-2.03tasks:4  - weather-forecast5frameworks:6  - pytorch7language:8  - en9  - zh10tags:11  - OneScience12  - Earth Science13  - Weather Forecast14  - Short-to-Medium-Range Weather Forecast15  - ERA516datasets:17 - OneScience/ERA518---19<p align="center">20  <strong>21    <span style="font-size: 30px;">Pangu-Weather</span>22  </strong>23</p>24 25# Model Introduction26 27Pangu-Weather is a global medium-range weather forecast model proposed by Huawei Cloud, capable of rapidly predicting surface variables and multi-pressure-level upper-air variables.28 29Paper: Accurate medium-range global weather forecasting with 3D neural networks  30https://www.nature.com/articles/s41586-023-06185-331 32# Model Description33 34Pangu-Weather is based on a 3D Earth-Specific Transformer architecture, trained on ERA5 data, and designed for short-to-medium-range weather forecasting.35 36# Use Cases37 38| Scenario | Description |39| :---: | :--- |40| Weather Forecast Training | Train Pangu-Weather using ERA5 HDF5 data |41| Local Quick Validation | Use synthetic data to verify data loading, model training & inference, and inference result visualization. |42| ModelScope / OneCode Execution | Download as a standalone model package, install dependencies, and run scripts directly. |43| Multi-GPU Training | Launch multi-process training via `torchrun`. |44 45# Usage Guide46 47## 1. OneCode Usage48 49Experience intelligent one-click AI4S programming through the OneCode online environment:50 51[Click to Experience Intelligent One-Click AI4S Programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)52 53## 2. Manual Installation and Usage54 55**Hardware Requirements**56 57- A GPU or DCU is recommended.58- CPU can be used for import and small-scale connectivity verification; full training and inference will be slow.59- DCU users must install DTK in advance. DTK 25.04.2 or above, or the OneScience recommended version matching your cluster, is recommended.60 61### Download the Model Package62 63```bash64hf download OneScience-Group/Pangu-Weather --local-dir ./pangu_weather65cd pangu_weather66```67 68### Install the Runtime Environment69 70**DCU Environment**71 72```bash73# Please activate DTK and CONDA first74conda create -n onescience311 python=3.11 -y75conda activate onescience31176# uv installation is supported77pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai78```79 80**GPU Environment**81```bash82# Please activate CONDA first83conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=1284conda activate onescience31185# uv installation is supported86pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai87```88 89### Training Data Introduction90 91The OneScience community provides ERA5 data for training (due to file size limits, the current repository contains a slice of the full dataset). Users can download it with the command below and confirm that the data path in `conf/config.yaml` is set correctly:92 93```bash94hf download --repo-type dataset OneScience-Group/ERA5 --local-dir ./data95```96 97### Training98 99Single GPU:100 101```bash102python scripts/train.py103```104 105Multi-GPU:106 107```bash108torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py109```110 111Training will save `model_bak.pth` under `data/checkpoints/`.112 113### Training Weights114 115This repository provides weights trained on ERA5 data from 1979 to 2025 in the `weights/` folder. At the 6-hour forecast lead time, these weights outperform the official open-source ONNX weights.116 117### Inference118 119```bash120python scripts/inference.py121```122 123Inference results will be saved to `result/output/`.124 125### Evaluation and Visualization126 127```bash128python scripts/result.py129```130 131# OneScience Official Information132 133| Platform | OneScience Main Repository | Skills Repository |134| --- | --- | --- |135| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |136| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |137 138# Citation & License139 140- This repository is a reproduction of the original Pangu-Weather paper.141