Error when running loo with moment_match = TRUE on rstan model from previous session
还没有人认领这个 Issue。
评估
调研方向
从报告中链接的 loo(fit, moment_match = TRUE) 入口点和 rstan/R/loo.R 实现开始。先保存并重新加载一个 stanfit,再调用 loo,以复现该失败,然后将其与同一 session 中的调用进行比较。完成标准是重新加载的模型能够完成 moment matching,且不会出现无效模型错误,并有一个覆盖保存并重新加载案例的回归测试。
由索引模型根据 Issue 内容生成。
描述
Hi,
I'm trying to run loo with moment matching on an rstan model fit in a previous session. The stanfit object was saved using:
fit <- stan(...)
saveRDS(fit,...)
And then loaded and loo (from https://github.com/stan-dev/rstan/blob/develop/rstan/rstan/R/loo.R) was run with:
fit <- loadRDS(...)
loo(fit, moment_match = TRUE)
which throws the following error:
Error in .local(object, ...) :
the model object is not created or not valid
Calls: loo ... apply -> FUN -> <Anonymous> -> <Anonymous> -> .local
Execution halted
Fitting and loading are both happening on the same system (university HPC cluster). I have no problems loading the stanfit object and then running other functions on this system (running extract(fit) for example) or loading the stanfit object on my local system (Mac OS 11.2.1). This also works fine if the model is fit and then loo is run within the same session (i.e. not from a .rds file).
HPC Cluster specs:
cat /etc/*-release
Cluster Manager v9.1
slave
NAME="Red Hat Enterprise Linux"
VERSION="8.2 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.2"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.2 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.2:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.2
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.2"
Red Hat Enterprise Linux release 8.2 (Ootpa)
Red Hat Enterprise Linux release 8.2 (Ootpa)
R environment specs:
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
rstan (version 2.21.2)
Thanks for your help and developing such an awesome package! If this is an rstan and not a loo problem I'm happy to move the issue there.
- 主要语言
- R
- 星标
- 157
- 派生
- 38
- 平均合并
- 4 天 16 小时
- 30 天内合并 PR
- 2
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stan-dev/loo 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 3/5 1-2 天 新手友好度 68/100
-
Clean up issues 未关闭
难度 4/5 3-5 天 新手友好度 25/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
briandconnelly/airnow#9 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
OHDSI/CohortConstructor#774 ·
-
pre-review R TeX Track: 5 (DSAIS)
难度 1/5 1 小时以内 新手友好度 60/100
openjournals/joss-reviews#11330 · 7 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100