Files

47 lines
2.0 KiB
TeX
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
\chapter{系统运行说明}
\section{环境配置}
本项目基于Python 3.13开发,使用uv进行虚拟环境和依赖管理。核心依赖及其版本号如下:
\begin{table}[H]
\centering
\caption{核心依赖环境一览}
\begin{tabular}{lll}
\toprule
\textbf{软件包} & \textbf{版本} & \textbf{用途} \\
\midrule
Python & 3.13.13 & 编程语言 \\
PyTorch & 2.12.0+cu126 & 深度学习框架(GPU训练) \\
XGBoost & 2.0+ & 梯度提升模型 \\
Scikit-learn & 1.3+ & 评估指标和数据处理 \\
Flask & 3.0+ & Web后端框架 \\
xarray + h5netcdf & 2023+/1.8+ & NetCDF文件处理 \\
NumPy + Pandas & 1.26+/2.1+ & 数据处理 \\
Matplotlib & 3.8+ & 图表生成 \\
CDSAPI & 0.7.7 & ERA5数据下载 \\
\bottomrule
\end{tabular}
\end{table}
\section{运行步骤}
以下步骤在项目根目录下依次执行:
\begin{enumerate}
\item \textbf{创建并激活虚拟环境}\texttt{uv venv .venv \&\& .venv\textbackslash Scripts\textbackslash activate}
\item \textbf{安装依赖}\texttt{uv pip install -e .}
\item \textbf{下载 ERA5 数据}(耗时约5天):\texttt{python -m src.data.download\_era5}
\item \textbf{解压 ZIP 格式数据}(耗时<1秒):\texttt{python -m src.data.extract\_zips}
\item \textbf{运行预处理}(耗时约27分钟):\texttt{python -m src.data.preprocess}
\item \textbf{训练LSTM模型}(可选,耗时取决于epoch数):\texttt{python -m src.models.train}
\item \textbf{评估模型(含XGBoost训练)}\texttt{python -m src.models.evaluate}
\item \textbf{启动可视化大屏}\texttt{python -m src.web.app}
\item \textbf{浏览器访问}\texttt{http://localhost:5005}
\end{enumerate}
\textbf{注意事项:}
\begin{enumerate}
\item 步骤3ERA5下载)需在Copernicus CDS网站接受数据许可协议
\item 需在用户目录配置\texttt{\textasciitilde/.cdsapirc}文件(URL + API Key
\item 如仅需查看大屏效果,可在无模型文件时直接启动步骤8(系统自动降级为默认预测)
\end{enumerate}