Comments (1)
eval_by_batch
函数和keep_batch
属性是为了解决FourCastNet评估占用显存过大的问题而设计的,考虑到FourCastNet的样本间相互独立,因此首先为每个batch内的样本计算各自的指标(假设此处单个样本的指标为0-D标量),然后暂不进行reduce操作,从而得到形状为[batch_size, ]
的batch_metric,最终把每个batch_metric在第0维拼接在一起,得到形状为[num_samples, ]
的full_metric,再做reduce_sum或其他操作,计算整个dataset的指标。
然后看你的报错看起来是手动设置了Metric的keep_batch属性为True,并且metric的计算返回结果是一个标量,所以导致concat([标量,标量, ...])
时报错。所以我觉得有可能是因为你的metric.forward函数返回的形状不符合[batch_size,]
这一要求。
- 可以尝试设置所有metric的keep_batch为False,
- 保证metric.forward的返回形状是否是
[batch_size,]
的形式,参考MAE metric(当然这也许现在看来不一定合理,可以随时在issue里反馈) - 用stack代替concat并不是一个正确的解决方式,因为出错的原因可能并不出在这里
from paddlescience.
Related Issues (20)
- PIRBN模型复现
- 【快乐开源】迁移 AMGNet 案例至 PaddleScience HOT 2
- 【快乐开源】复现 Phy-LSTM 论文 HOT 2
- 【快乐开源】为 PaddleScience 添加 HamiltonianMonteCarlo API HOT 3
- where is volterra HOT 1
- 优化文档结构,增强非专业领域人员可读性,增加应用场景描述,实验图表注明各变量物理意义 HOT 3
- 安装paddlescience报错 HOT 7
- 【快乐开源】基于hydra的案例改造计划 HOT 8
- bracket评估命令错误 HOT 1
- 关于定常问题初始流场设置 HOT 2
- 【快乐开源】补充汽车CFD数据集(Shape-Net Car)至 PaddleScience
- 【快乐开源】补充汽车CFD数据集(Ahmed)至 PaddleScience
- 【快乐开源】科学计算 API 文档补全 HOT 13
- 如何实现求三阶导数 HOT 3
- AI Studio快速体验ldc2d_steady_Re10完整代码出现error HOT 1
- 【快乐开源】为 PaddleScience 案例添加 export 和 inference 功能 HOT 21
- 【快乐开源】为PaddleScience添加chamfer distance loss HOT 1
- 训练的时候出现反向传播错误 HOT 7
- paddle和torch前向对齐,有误差 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paddlescience.