---
title: FourCastNet
canonical_url: "https://www.modelscope.cn/models/OneScience/FourCastNet"
md_url: "https://www.modelscope.cn/models/OneScience/FourCastNet.md"
repository: OneScience/FourCastNet
last_updated: 2026-07-22
license: "Apache License 2.0"
library_name:
  - pytorch
frameworks:
  - PyTorch
language:
  - en
  - zh
downloads: 10
stars: 0
tags:
  - OneScience
  - "地球科学"
  - "气象预报"
  - "短中期气象预报"
  - ERA5
---

# FourCastNet

> FourCastNet - OneScience 在 ModelScope 开源的模型。FourCastNet（Fourier ForeCasting Neural Network）是基于 AFNO（Adaptive Fourier Neural Operator）的、由NVIDIA联合多家顶尖学术机构共同开发的全球天气预报模型。

OneScience/FourCastNet 是 ModelScope 魔搭社区上的机器学习模型，采用 Apache License 2.0 许可。

- **Repository**: OneScience/FourCastNet
- **License**: Apache License 2.0
- **Tags**: OneScience, 地球科学, 气象预报, 短中期气象预报, ERA5
- **Downloads**: 10
- **Stars**: 0
- **Last updated**: 2026-07-22

Source: https://www.modelscope.cn/models/OneScience/FourCastNet

---

<p align="center">
  <strong>
    <span style="font-size: 30px;">FourCastNet</span>
  </strong>
</p>


# 模型介绍

FourCastNet（Fourier ForeCasting Neural Network）是基于 AFNO（Adaptive Fourier Neural Operator）的、由NVIDIA联合多家顶尖学术机构共同开发的全球天气预报模型。

论文：FourCastNet: A Global Data-driven High-resolution Weather Forecasting Model

https://arxiv.org/abs/2202.11214

# 模型描述
FourCastNet 是基于自适应傅里叶神经算子的全球高分辨率天气预报模型，适用于中短期全球天气预报研究。

# 适用场景

| 场景 | 说明 |
| :---: | :--- |
| 全球天气预报研究 | 基于年度 ERA5 HDF5 数据训练 FourCastNet 风格的 AFNO 预报模型。 |
| 本地快速验证 | 使用虚拟数据检查数据读取、训练入口、推理和结果脚本。 |
| ModelScope/OneCode 运行 | 作为独立模型包下载后直接安装依赖并运行脚本。 |
| 多卡训练 | 通过 `torchrun` 启动多进程训练。 |


# 使用说明

## 1. OneCode 使用

可通过 OneCode 在线环境体验智能化一键式 AI4S 编程：

[点击体验智能化一键式 AI4S 编程](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)

## 2. 手动安装使用

**硬件要求**

- 推荐使用 GPU 或 DCU 运行。
- CPU 可以用于导入和小配置连通性验证，完整训练和推理速度较慢。
- DCU 用户需要预先安装 DTK，建议使用 DTK 25.04.2 以上版本或与当前集群匹配的 OneScience 推荐版本。


### 下载模型包

```bash
modelscope download --model OneScience/FourCastNet --local_dir ./FourCastNet
cd FourCastNet
```

### 安装运行环境

**DCU环境**

```bash
# 请首先激活DTK及CONDA
conda create -n onescience311 python=3.11 -y
conda activate onescience311
# 支持uv安装
pip install onescience[earth-dcu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai
```

**GPU环境**
```bash
# 请首先激活CONDA
conda create -n onescience311 python=3.11 -y libstdcxx-ng=12 libgcc-ng=12 gcc_linux-64=12 gxx_linux-64=12
conda activate onescience311
# 支持uv安装
pip install onescience[earth-gpu] -i http://mirrors.onescience.ai:3141/pypi/simple/  --trusted-host mirrors.onescience.ai
```

### 训练数据介绍

OneScience 社区提供可供训练的 ERA5 数据（受数据文件大小限制，当前仓库内为完整数据切片），用户可通过下述命令下载，并确认 `conf/config.yaml` 中数据路径设置正确：

```bash
modelscope download --dataset OneScience/ERA5 --local_dir ./data
```

### 训练

单卡：

```bash
python scripts/train.py
```

多卡：

```bash
torchrun --nproc_per_node=8 --nnodes=1 --rdzv_id=1000 --rdzv_backend=c10d --max_restarts=0 --master_addr="localhost" --master_port=29500 scripts/train.py
```

训练输出：

```text
data/checkpoints/model_bak.pth
data/checkpoints/trloss.npy
data/checkpoints/valoss.npy
```

### 训练权重
本仓库在weights/文件夹内提供基于 ERA5 再分析数据训练的权重，权重文件即将上传，预计将于近期完成。

### 推理

推理默认读取 `data/checkpoints/model_bak.pth`：

```bash
python scripts/inference.py
```

预测结果输出到：

```text
result/output/
```

### 评估与可视化

```bash
python scripts/result.py
```

输出内容包括：

- `result/rmse.npy`
- `result/acc.npy`
- `result/loss.png`
- 指定日期和变量的预报对比图


# OneScience 官方信息

| 平台 | OneScience 主仓库 | Skills 仓库 |
| --- | --- | --- |
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |

# 引用与许可证

- 本仓库为 FourCastNet 的独立复现，架构设计参考自 Pathak 等人（2022）的原始论文。
