Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in dim(x) <- length(x) : attempt to set an attribute on NULL #732

Open
njtierney opened this issue Oct 17, 2024 · 0 comments
Open

Comments

@njtierney
Copy link
Collaborator

Got a little mysterious bug here, it only comes up sometimes, but just logging it here so I can refer back to this.

>   lkj_checked <- check_samples(
+     x = x,
+     iid_function = iid,
+     sampler = hmc(),
+     one_by_one = TRUE
+   )
running 4 chains simultaneously on up to 8 CPU cores

    warmup                                      0/1000 | eta:  ?s          Error in dim(x) <- length(x) : attempt to set an attribute on NULL
Called from: as.array.default(batch_results$all_states)
Browse[1]> traceback()
No traceback available 
Browse[1]> n
> traceback()
14: as.array.default(batch_results$all_states)
13: as.array(batch_results$all_states) at inference_class.R#747
12: self$run_burst(n_samples = burst_lengths[burst]) at inference_class.R#401
11: sampler$run_chain(n_samples = n_samples, thin = thin, warmup = warmup, 
        verbose = verbose, pb_update = pb_update, one_by_one = one_by_one, 
     ... at inference.R#381
10: dispatch(sampler$run_chain(n_samples = n_samples, thin = thin, 
        warmup = warmup, verbose = verbose, pb_update = pb_update, 
     ... at inference.R#388
9: run_samplers(samplers = samplers, n_samples = n_samples, thin = thin, 
       warmup = warmup, verbose = verbose, pb_update = pb_update, 
    ... at inference.R#265
8: force(expr)
7: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch(force(expr), finally = {
       data$`__exit__`(NULL, NULL, NULL)
    ...
5: with.python.builtin.object(tf$device(compute_options), {
       message_if_using_gpu(compute_options)
    ...
4: with(tf$device(compute_options), {
       message_if_using_gpu(compute_options)
    ... at inference.R#204
3: mcmc(model, sampler = sampler, verbose = verbose, one_by_one = one_by_one) at helpers.R#739
2: get_enough_draws(model = m, sampler = sampler, n_effective = n_effective, 
       verbose = TRUE, one_by_one = one_by_one, time_limit = time_limit) at helpers.R#854
1: check_samples(x = x, iid_function = iid, sampler = hmc(), one_by_one = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant