weathernext

数据集与模型

google-deepmind/weathernext

谷歌 DeepMind 的全球天气预报 AI 模型。

项目简介

WeatherNext 是谷歌 DeepMind 推出的全球中期天气预报与气旋追踪 AI 模型套件,包含最新的 WeatherNext 2 以及早期的 GraphCast 和 GenCast。仓库提供代码、预训练权重和文档,可用于运行预测。

README 预览

# WeatherNext\n\n## WeatherNext 2\n\nThis repo contains the code for WeatherNext 2 (WN2), the global, medium-range\natmospheric and cyclone forecasting model developed by Google DeepMind and\nGoogle Research.\n\nIt also contains code for prior generation models\n[GraphCast](https://deepmind.google/blog/graphcast-ai-model-for-faster-and-more-accurate-global-weather-forecasting/)\nand\n[GenCast](https://deepmind.google/blog/gencast-predicts-weather-and-the-risks-of-extreme-conditions-with-sota-accuracy/).\n\n### Accessing Forecast Data Feeds\nIf you are interested in directly accessing daily data feeds of WN2 model\noutputs rather than running the model yourself, we provide them across multiple\nplatforms:\n\n*   [Google Cloud](https://developers.google.com/weathernext/guides/access-forecast)\n(including Earth Engine, BigQuery, and Vertex AI).\n*   [WeatherLab](https://deepmind.google.com/science/weatherlab) (including cyclone tracks).\n*   [OpenMeteo](https://open-meteo.com/en/docs/google-weathernext-api) (including an API and interactive builder).\n\n### Learn More\n\n*   **Model Guide & Documentation:** [Google Developers WeatherNext Guide](https://developers.google.com/weathernext/guides/models)\n*   **WeatherNext Cyclones Paper:** [Operational tropical cyclone forecasting\n    with AI](https://www.nature.com/articles/s41586-026-10953-2)\n*   **FGN/WN2 Technical Report:** [Skillful joint probabilistic weather\n    forecasting from marginals\n    (arXiv:2506.10772)](https://arxiv.org/abs/2506.10772)\n*   **WeatherNext 2 Blog Post:** [WeatherNext 2: Our most advanced weather forecasting model](https://blog.google/innovation-and-ai/models-and-research/google-deepmind/weathernext-2/)\n*   **WeatherNext Cyclones Blog Post:** [WeatherNext: AI model achieves breakthrough in forecasting cyclones](https://deepmind.google/blog/weathernext-ai-model-achieves-breakthrough-in-forecasting-cyclones/)\n\n### Older Models\n\nThis repository serves as the primary home for the Weathe

常见问题 (5)

故障排除
如何在保留 batch 维度的同时,从 xarray 变量中移除 batch 坐标?

使用 drop_vars() 可以在不移除维度的情况下移除维度坐标:

xr_dataset = xr_dataset.drop_vars("batch")

这样 batch 仍然是 Temp 和 datetime 的维度,但它会变成一个没有坐标的维度,与示例 NetCDF 文件一致。

或者,在创建 Dataset 时省略 batch:

coords = {
    "time": ("time", times),
    "channel": [0],
    "lon": ("lon", lons),
    "lat": ("lat", lats),
    "datetime": (("batch", "time"), [datetimes]),
}

即使 batch 未在 coords 中定义,batch 维度仍会从变量的形状中推断出来。

来源 Issue #90
informational
GraphCast 业务化微调使用的目标数据集是什么?

在 GraphCast_operational 微调中,降水目标数据来自 ERA5,而所有其他变量使用 HRES-fc0 场。损失是在 GraphCast 输出与这些混合目标之间计算的——而不是对所有变量都使用 ERA5。

来源 Issue #190
故障排除
如何修复安装 Graphcast 时出现的 "AttributeError: module 'jax.stages' has no attribute 'OutInfo'" 错误?

这是由 master.zip 快照中不兼容的 Graphcast/JAX 版本导致的,已在最近的 Graphcast 提交中修复。请重新安装最新源代码,然后重启 Python/Colab 运行时:

pip install --upgrade --no-cache-dir https://github.com/google-deepmind/graphcast/archive/master.zip

或者,直接从 Git 安装:

pip install --upgrade --no-cache-dir git+https://github.com/google-deepmind/graphcast.git

安装完成后,重启内核/运行时并重新导入 Graphcast。如果你的环境固定了 JAX 版本,请确保其与最新的 Graphcast 版本兼容,而不要使用单独升级的 JAX 版本。

来源 Issue #189
故障排除
如何使用最新的 ERA5 数据运行 GraphCast,同时保持预处理和归一化与预训练检查点一致?

您不必只使用官方提供的历史 GraphCast 格式数据。请构建一个 ERA5 转换流水线,并首先对照官方示例数据对其进行验证:(1) 下载所提供的 GraphCast 示例数据集已涵盖日期的原始 ERA5 数据;(2) 使用与预训练模型相同的变量选择、气压层、网格、单位、时间处理和归一化方法对其进行转换;(3) 将您的输出与官方示例进行比较,直至完全一致;(4) 转换器验证通过后,在更新的 ERA5 分析数据上运行相同且未经修改的代码。这种精确匹配验证是推荐的方法,可确保最新的输入数据与预训练 checkpoint 在科学和技术层面均兼容。

来源 Issue #200
故障排除
如何在多个 GPU 或一个 TPU v3-8 上运行 GraphCast 高分辨率推理而不会内存不足?

GraphCast 目前不支持单次预报的模型并行推理。xarray_jax.pmap 只能在批次维度上将工作分配到多个设备,因此每个设备仍需加载完整模型;它不会对 GNN 进行分片,也不会降低单个高分辨率样本的内存占用。请使用至少 24 GB 显存的 GPU,或使用每个芯片提供 32 GB 显存的 TPU v4。TPU v3 每个芯片仅有 16 GB 显存,即使在 v3-8 上也可能出现 OOM。对于低内存推理,可以尝试社区项目 graphcast-lite,据报告该项目可在 RTX 2080 上使用 float32 运行 0.25° 分辨率、37 个气压层的预报:https://github.com/VectorElectron/graphcast-lite。仅当您有多个独立的预报需要作为批次运行时,才使用 pmap。

来源 Issue #33