Error when running loo with moment_match = TRUE on rstan model from previous session
まだ誰も着手していません。
評価
調査の方向性
レポートに記載されている loo(fit, moment_match = TRUE) エントリポイントと rstan/R/loo.R の実装から始めます。loo を呼び出す前に stanfit を保存して再読み込みし、失敗を再現してから、同一セッションでの呼び出しと比較します。再読み込みしたモデルが invalid-model error なしで 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時間
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
stan-dev/loo のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 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