当前位置: 首页 > news >正文

claude4

我们发现还是出现错误`PS D:\PRformer> python -u run.py --is_training 1 --model_id test_v1 --root_path ./dataset/ETT-small/ --data_path ETTh1.csv --model PRformer --data ETTh1 --features M --seq_len 720 --label_len 48 --pred_len 96 --train_epochs 2 --batch_size 32 --convWindows 24 48 72 144 --rnnMixTemperature 0.002 --des Test --e_layers 2 --d_layers 1 --d_model 512 --d_ff 2048
Args in experiment:
Namespace(is_training=1, model_id='test_v1', model='PRformer', data='ETTh1', root_path='./dataset/ETT-small/', data_path='ETTh1.csv', features='M', target='OT', freq='h', checkpoints='./checkpoints/', seq_len=720, label_len=48, pred_len=96, seasonal_patterns='Monthly', enc_in=7, dec_in=7, c_out=7, d_model=512, n_heads=8, e_layers=2, d_layers=1, d_ff=2048, moving_avg=25, factor=1, distil=True, dropout=0.1, embed='timeF', activation='gelu', output_attention=False, num_workers=10, itr=1, train_epochs=2, batch_size=32, patience=3, learning_rate=0.0001, des='Test', loss='MSE', lradj='type1', use_amp=False, use_gpu=True, gpu=0, use_multi_gpu=False, devices='0,1,2,3', exp_name='None', efficient_training=False, channel_independence=False, inverse=False, class_strategy='projection', target_root_path='./data/electricity/', target_data_path='electricity.csv', convWindows=[24, 48, 72, 144], rnnMixTemperature=0.002)
Use GPU: cuda:0

start training : test_v1_PRformer_ETTh1_M_ft720_sl48_ll96_pl512_dm8_nh2_el1_dl2048_df1_fctimeF_ebTrue_dtTest_projection_0>>>>>>>>>>>>>>>>>>>>>>>>>>
train 7825
val 2785
test 2785
iters: 100, epoch: 1 | loss: 0.4086269
speed: 0.3070s/iter; left time: 119.4059s
iters: 200, epoch: 1 | loss: 0.3768452
speed: 0.0218s/iter; left time: 6.2863s
Epoch: 1 cost time: 33.58464050292969
Epoch: 1, Steps: 244 | Train Loss: 0.3750640 Vali Loss: 0.7134643 Test Loss: 0.3772548
Updating learning rate to 0.0001
iters: 100, epoch: 2 | loss: 0.3199691
speed: 0.9780s/iter; left time: 141.8099s
iters: 200, epoch: 2 | loss: 0.3178940
speed: 0.0218s/iter; left time: 0.9790s
Epoch: 2 cost time: 31.77220892906189
Epoch: 2, Steps: 244 | Train Loss: 0.3377394 Vali Loss: 0.6909371 Test Loss: 0.3732766
Updating learning rate to 5e-05
Traceback (most recent call last):
File "D:\PRformer\run.py", line 131, in
exp.train(setting)
File "D:\PRformer\experiments\exp_long_term_forecasting.py", line 190, in train
self.model.load_state_dict(torch.load(best_model_path))
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\Python311\Lib\site-packages\torch\serialization.py", line 1530, in load
with _open_file_like(f, "rb") as opened_file:
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\Python311\Lib\site-packages\torch\serialization.py", line 795, in _open_file_like
return _open_file(name_or_buffer, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Program Files\Python311\Lib\site-packages\torch\serialization.py", line 776, in init
super().init(open(name, mode)) # noqa: SIM115
^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './checkpoints/test_v1_PRformer_ETTh1_M_ft720_sl48_ll96_pl512_dm8_nh2_el1_dl2048_df1_fctimeF_ebTrue_dtTest_projection_0/checkpoint.pth'`

Compacted conversation太好了!✅ torch.cat的修复有效了! 模型成功运行了2个epoch,说明之前的维度问题已经解决。

新的报错是关于checkpoint加载的问题。让我查看一下Early Stopping的保存逻辑: Optimizing tool selection...

Read [](file:///d%3A/PRformer/experiments/exp_long_term_forecasting.py#140-140), lines 140 to 200

Searched for text class EarlyStopping, 1 result

Read [](file:///d%3A/PRformer/utils/tools.py#42-42), lines 42 to 80

问题找到了!🔍 在 exp_long_term_forecasting.py,Early Stopping只在 epoch > 3时才保存checkpoint。你的 train_epochs=2,所以永远不会保存checkpoint文件。

修复这个条件:

Replacing 4 lines with 3 lines in [](file:///d%3A/PRformer/experiments/exp_long_term_forecasting.py)


✅ 已修复!现在Early Stopping会从第一个epoch就开始保存checkpoint。重新运行测试命令:

python -u run.py --is_training 1 --model_id test_v1_fixed --root_path ./dataset/ETT-small/ --data_path ETTh1.csv --model PRformer --data ETTh1 --features M --seq_len 720 --label_len 48 --pred_len 96 --train_epochs 2 --batch_size 32 --convWindows 24 48 72 144 --rnnMixTemperature 0.002 --des Test_After_Fix --e_layers 2 --d_layers 1 --d_model 512 --d_ff 2048

这次应该能完整训练完两个epoch并成功保存checkpoint!

Made changes.

http://www.jsqmd.com/news/641124/

相关文章:

  • 别再乱选二极管了!BUCK/BOOST电路续流与整流二极管实战避坑指南
  • 3分钟上手Keyviz:让你的键盘操作像电影特效一样炫酷
  • Windows防火墙如何放行WSL2?手把手教你设置入站规则(含常见错误排查)
  • Cesium中高效集成天地图WMTS服务的实战指南
  • Axure中文界面安装指南:3步告别英文困扰,让原型设计更高效
  • 鲲鹏麒麟环境下MySQL5.7离线部署全流程解析
  • AIMP:轻量级音乐播放器解决音频播放与管理的常见问题
  • 告别网盘限速困扰:八大网盘直链下载助手完全指南
  • 告别复制粘贴!深入理解GD32F407的GPIO配置:推挽、开漏、复用AF到底怎么选?
  • AutoCAD字体管理终极指南:FontCenter免费插件完整解决方案
  • 为什么 Multi-Agent 是技术创业者的最大机会
  • STL体积计算器:3D打印模型体积与重量估算完整指南
  • Java SPI实战:从零实现一个可插拔的日志框架(附完整代码)
  • Noto字体:告别豆腐块困扰,打造完美多语言显示体验
  • 告别需求文档焦虑:用Spec-Kit + Claude Code,5分钟搞定你的C++五子棋项目规划
  • 当网盘限速成为日常,这款工具如何让我重获下载自由?
  • 从零到部署:为你的UG/NX二次开发插件制作专业级菜单界面(MenuScript实战指南)
  • 如何在OBS中实现免费本地AI语音识别:LocalVocal完全指南
  • 保姆级教程:在Linux下排查PCIe RootPort Completion Timeout错误(附抓包与日志分析)
  • MogFace人脸检测模型-WebUI实操手册:Linux服务器部署、日志排查、性能调优
  • 揭秘LLaVA-ViL-Flamingo三大主流多模态模型的“黑箱决策路径”:如何用Grad-CAM++与Concept Activation Vector精准定位图文推理漏洞?
  • 【Scala PyTorch深度学习】PyTorch On Scala 系列课程 第五章 10 :数据集【AI Infra 3.0】[PyTorch Scala 硕士研一课程]
  • 告别环境配置焦虑:在Ubuntu 22.04上5分钟搞定ESP-IDF v5.4.2(含永久串口权限设置)
  • 本地化基因ID转换工具开发指南:从NCBI数据到高效pipeline集成
  • WinRAR弹窗广告终极去除指南
  • 告别sasquatch报错:手把手教你用squashfs-tools 4.5+搞定binwalk解压lzma压缩的固件
  • GeoServer进阶指南:多层级TIF地图数据的切片与缓存优化
  • 为什么PPTist是Vue 3开发者的终极在线演示文稿解决方案?
  • 为什么你的ECR变更总出问题?精益生产工程变更的4个核心管控要点
  • M2LOrder模型企业级内网穿透部署方案:安全访问GPU算力