Closed zhiiiyang closed 2 years ago
Hi there!
Hmm, I can't replicate this on my system, can you tell me what happens when you run:
library(greta)
remove_greta_env()
remove_miniconda()
install_greta_deps()
Can you also tell me the version of Rstudio you are running? You can find this by running
RStudio.Version()
@njtierney, thank you for the comment. I have attached it below.
ℹ removing 'miniconda' installation
✓ 'miniconda' successfully removed!
$citation
To cite RStudio in publications use:
RStudio Team (2021). RStudio: Integrated Development Environment for R. RStudio,
PBC, Boston, MA URL http://www.rstudio.com/.
A BibTeX entry for LaTeX users is
@Manual{,
title = {RStudio: Integrated Development Environment for R},
author = {{RStudio Team}},
organization = {RStudio, PBC},
address = {Boston, MA},
year = {2021},
url = {http://www.rstudio.com/},
}
$mode
[1] "desktop"
$version
[1] ‘2021.9.0.351’
$long_version
[1] "2021.09.0+351"
$release_name
[1] "Ghost Orchid"
Hi @zhiiiyang - I think that this is an issue with your version of RStudio, noted here: https://github.com/rstudio/rstudio/issues/9928 . This was an issue to do with how Rstudio found python. I believe it has been resolved now.
Can you install the latest version of RStudio and try this again? https://www.rstudio.com/products/rstudio/download/#download
@njtierney, I have installed the latest RStudio version and reran install_greta_deps()
. The installation seems to be successful. But the R session still crashed after running greta_sitrep()
.
✓ greta-env environment created!
• To see full installation notes run:
• `greta_notes_conda_create_output()`
• To see any error messages, run:
• `greta_notes_conda_create_error()`
✓ Python modules installed!
• To see full installation notes run:
• `greta_notes_conda_install_output()`
• To see any error messages, run:
• `greta_notes_conda_install_error()`
✓ Installation of greta dependencies is complete!
• Restart R, then load greta with: `library(greta)`
Hi @zhiiiyang - sorry to hear that hasn't quite worked!
To confirm, you are not able to use greta
then - that is, code like this also results in an Rstudio crash?
library(greta)
x <- normal(0,1)
mcmc(model(x))
Can you also try the following with the reprex
package:
library(reprex)
reprex(greta::greta_sitrep())
This should run the code in a fresh session of R and (hopefully) give some more details on what is going on
Two things that might help us narrow down the issue:
install_greta_deps()
can you share the output of the various outputs and errors stored in the following:greta_notes_conda_create_output()
greta_notes_conda_create_error()
greta_notes_conda_install_output()
greta_notes_conda_install_error()
Note that those above will only be accessible immediately after running the installation.
@njtierney, thank you for helping out. I started a fresh R session and re-ran the code below.
ℹ Initialising python and checking dependencies, this may take a moment.
> library(reprex)
> reprex(greta::greta_sitrep())
x Install the styler package in order to use `style = TRUE`.
ℹ Rendering reprex...
Error in `reprex_render_impl()`:
! This reprex appears to crash R
Call `reprex()` again with `std_out_err = TRUE` to get more info
Run `rlang::last_error()` to see where the error occurred.
library(greta) x <- normal(0,1) mcmc(model(x))
> greta_notes_conda_create_output()
If you are reading this, the greta installation or error notes have been wiped.> greta_notes_conda_create_error()
> greta_notes_conda_install_output()
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done
==> WARNING: A newer version of conda exists. <== current version: 4.10.3 latest version: 4.13.0
Please update conda by running
$ conda update -n base conda
Hi, I just updated it to R 4.2. The crash still persists after running greta::greta_sitrep()
Hi @zhiiiyang
Thanks for posting the detailed information here - I'm sorry that things haven't worked so far, but I think I might have a solution based on the code you've provided. Your example here showing that there is an issue where conda wants to be updated reminded me of Ross's issue that he posted here:
Are you able to try
reticulate::conda_update()
And then
greta::install_greta_deps()
Let me know how you go?
@njtierney, thank you for the suggestion. The R session still crashed after these two lines of code.
Hi @zhiiiyang
Sorry to hear that this hasn't quite worked yet.
Can you try:
reprex(greta::greta_sitrep(), std_out_error = TRUE, si = TRUE)
And paste in the reprex information it gives? This should tell me the a bit more about the error and also give system information.
Another thing to try is this:
library(greta)
remove_greta_env()
remove_miniconda()
install_greta_deps()
Then, before you restart, can you show the output of the following?
greta_notes_conda_create_error()
greta_notes_conda_create_output()
greta_notes_conda_install_error()
greta_notes_conda_install_output()
greta_notes_install_miniconda_error()
greta_notes_install_miniconda_output()
@njtierney Here you go.
See screenshot below
Nothing happened after running the code. When I reran the following code before and after restarting, it still crashed.
library(greta)
x <- normal(0,1)
mcmc(model(x))
@zhiiiyang
Sorry I got the option wrong - can you try this:
reprex(greta::greta_sitrep(), std_out_err = TRUE, si = TRUE)
And can you copy the reprex that is output from that? It should automatically copy it to the clipboard, so you should be able to paste something like:
greta::greta_sitrep()
#> ℹ checking if python available
#> ✔ python (v3.8) available
#>
#> ℹ checking if TensorFlow available
#> ✔ TensorFlow (v2.8.0) available
#>
#> ℹ checking if TensorFlow Probability available
#> ✔ TensorFlow Probability (v0.16.0) available
#>
#> ℹ checking if greta conda environment available
#> ✔ greta conda environment available
#>
#> ℹ Initialising python and checking dependencies, this may take a moment.
#> ✔ Initialising python and checking dependencies ... done!
#>
#> ℹ greta is ready to use!
Created on 2022-06-08 by the reprex package (v2.0.1)
So while a screenshot is useful here, if you can paste in the text that is copied from the reprex, I get more information that might be helpful.
I'm surprised that this:
library(greta)
remove_greta_env()
remove_miniconda()
install_greta_deps()
resulted in nothing happening - this should at least display a message describing the greta conda environment being removed, and miniconda being removed. Can you try running that in a fresh session (i.e., restart R and then run that code), and confirm that nothing happens?
I have two more thoughts on some things that could also be at play here.
Do you have any code that is running on startup with R? For example, in a .Rprofile
file? You can inspect this with usethis::edit_r_profile()
- if there is something in that file to do with tensorflow or python, then this could be the issue with greta - if I can know what that is then I can help more.
Are you able to run tensorflow normally? Can you for example run the following code?
reprex::reprex({
library(tensorflow)
as_tensor(1)
},
std_out_err = TRUE,
si = TRUE
)
@njtierney, here you go.
running reprex(greta::greta_sitrep(), std_out_err = TRUE, si = TRUE)
✖ Install the styler package in order to use `style = TRUE`.
*** caught illegal operation ***
address 0x15ab4a094, cause 'illegal opcode'
Traceback:
1: py_module_import(module, convert = convert)
2: import(module)
3: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch({ import(module) TRUE}, error = clear_error_handler(FALSE))
7: reticulate::py_module_available("tensorflow")
8: have_tf()
9: check_if_software_available(software_available = have_tf(), version = version_tf(), ideal_version = "1.14.0", software_name = "TensorFlow")
10: greta::greta_sitrep()
11: eval(expr, envir, enclos)
12: eval(expr, envir, enclos)
13: eval_with_user_handlers(expr, envir, enclos, user_handlers)
14: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers))
15: withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)
16: doTryCatch(return(expr), name, parentenv, handler)
17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
18: tryCatchList(expr, classes, parentenv, handlers)
19: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
20: try(f, silent = TRUE)
21: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler))
22: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)))
23: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, debug = debug, last = i == length(out), use_try = stop_on_error != 2L, keep_warning = keep_warning, keep_message = keep_message, output_handler = output_handler, include_timing = include_timing)
24: evaluate::evaluate(...)
25: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options))
26: in_dir(input_dir(), expr)
27: in_input_dir(evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options)))
28: eng_r(options)
29: block_exec(params)
30: call_block(x)
31: process_group.block(group)
32: process_group(group)
33: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), error = function(e) { setwd(wd) cat(res, sep = "\n", file = output %n% "") message("Quitting from lines ", paste(current_lines(i), collapse = "-"), " (", knit_concord$get("infile"), ") ") })
34: process_file(text, output)
35: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
36: rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")
37: (function (input) { rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")})(input = base::quote("piny-loon_reprex.R"))
38: (function (what, args, quote = FALSE, envir = parent.frame()) { if (!is.list(args)) stop("second argument must be a list") if (quote) args <- lapply(args, enquote) .Internal(do.call(what, args, envir))})(base::quote(function (input) { rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")}), base::quote(list(input = "piny-loon_reprex.R")), envir = base::quote(__callr_data__
err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$`callr_dump, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$
_ignore<- list(c(1, dcframe + 1L)) e2$
_pid<- Sys.getpid() e2$
_timestamp<- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e093280746d", ".error")) }}, interrupt = function(e) { { callr_data <- as.environment("tools:callr")$
callr_data` err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$__callr_dump__
, envir = callr_data) rm("callr_dump__", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$_ignore
<- list(c(1, dcframe + 1L)) e2$_pid
<- Sys.getpid() e2$_timestamp
<- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e093280746d", ".error")) }}, callr_message = function(e) { try(signalCondition(e))})
42: doTryCatch(return(expr), name, parentenv, handler)
43: tryCatchOne(expr, names, parentenv, handlers[[1L]])
44: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
45: doTryCatch(return(expr), name, parentenv, handler)
46: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
47: tryCatchList(expr, classes, parentenv, handlers)
48: tryCatch(withCallingHandlers({ NULL saveRDS(do.call(do.call, c(readRDS("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-fun-1e096e6ee50f"), list(envir = .GlobalEnv, quote = TRUE)), envir = .GlobalEnv, quote = TRUE), file = "/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e093280746d") flush(stdout()) flush(stderr()) NULL invisible()}, error = function(e) { { callr_data <- as.environment("tools:callr")$`callr_data` err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$`callr_dump`, envir = callr_data) rm("__callr_dump", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$_ignore
<- list(c(1, dcframe + 1L)) e2$_pid
<- Sys.getpid() e2$_timestamp
<- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e093280746d", ".error")) }}, interrupt = function(e) { { callr_data <- as.environment("tools:callr")$__callr_data__
err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$`callr_dump, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$
_ignore<- list(c(1, dcframe + 1L)) e2$
_pid<- Sys.getpid() e2$
_timestamp` <- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e093280746d", ".error")) }}, callr_message = function(e) { try(signalCondition(e))}), error = function(e) { NULL try(stop(e))}, interrupt = function(e) { NULL e})
An irrecoverable exception occurred. R is aborting now ...
2. This is what happened after running the code.
library(greta) remove_greta_env() remove_miniconda() install_greta_deps()
Output:
library(reprex) reprex(greta::greta_sitrep(), std_out_err = TRUE, si = TRUE) ✖ Install the styler package in order to use
style = TRUE
. ℹ Rendering reprex... ✔ Reprex output is on the clipboard.library(greta)
Attaching package: ‘greta’
The following objects are masked from ‘package:stats’:
binomial, cov2cor, poisson
The following objects are masked from ‘package:base’:
%*%, apply, backsolve, beta, chol2inv, colMeans, colSums, diag, eigen,
forwardsolve, gamma, identity, rowMeans, rowSums, sweep, tapply
remove_greta_env() ℹ removing 'greta-env' conda environment
- '/opt/miniconda3/bin/conda' 'remove' '--yes' '--name' 'greta-env' '--all'
Remove all packages in environment /opt/miniconda3/envs/greta-env:
environment location: /opt/miniconda3/envs/greta-env
The following packages will be REMOVED:
absl-py-1.1.0-pyhd8ed1ab_0 astor-0.8.1-pyh9f0ad1d_0 c-ares-1.18.1-h0d85af4_0 ca-certificates-2022.5.18.1-h033912b_0 cloudpickle-2.1.0-pyhd8ed1ab_0 decorator-5.1.1-pyhd8ed1ab_0 gast-0.5.3-pyhd8ed1ab_0 google-pasta-0.2.0-pyh8c360ce_0 grpcio-1.46.3-py37h7ec71ce_0 h5py-2.10.0-nompi_py37h28defc4_104 hdf5-1.10.6-nompi_haae91d6_101 importlib-metadata-4.11.4-py37hf985489_0 keras-applications-1.0.8-py_1 keras-preprocessing-1.1.2-pyhd8ed1ab_0 libblas-3.9.0-8_openblas libcblas-3.9.0-8_openblas libcxx-14.0.4-hc203e6f_0 libffi-3.4.2-h0d85af4_5 libgfortran-4.0.0-7_5_0_h1a10cd1_23 libgfortran4-7.5.0-h1a10cd1_23 liblapack-3.9.0-8_openblas libopenblas-0.3.12-openmp_h63d9170_1 libprotobuf-3.20.1-h2292cb8_0 libzlib-1.2.12-h6c3fc93_0 llvm-openmp-14.0.4-ha654fa7_0 markdown-3.3.7-pyhd8ed1ab_0 ncurses-6.3-h96cf925_1 numpy-1.16.4-py37h6b0580a_0 openssl-3.0.3-hfe4f2af_0 pip-22.1.2-pyhd8ed1ab_0 protobuf-3.20.1-py37hc568d09_0 python-3.7.12-hf3644f1_100_cpython python_abi-3.7-2_cp37m readline-8.1-h05e3726_0 scipy-1.5.1-py37hce1b9e5_0 setuptools-62.3.3-py37hf985489_0 six-1.16.0-pyh6c4a22f_0 sqlite-3.38.5-hd9f0692_0 tensorboard-1.14.0-py37_0 tensorflow-1.14.0-h3cdfc77_0 tensorflow-base-1.14.0-py37hc8dfbb8_0 tensorflow-estimator-1.14.0-py37h5ca1d4c_0 tensorflow-probability-0.7-py_3 termcolor-1.1.0-py_2 tk-8.6.12-h5dbffcc_0 typing_extensions-4.2.0-pyha770c72_1 werkzeug-2.1.2-pyhd8ed1ab_1 wheel-0.37.1-pyhd8ed1ab_0 wrapt-1.14.1-py37h994c40b_0 xz-5.2.5-haf1e3a3_1 zipp-3.8.0-pyhd8ed1ab_0 zlib-1.2.12-h6c3fc93_0
Preparing transaction: ...working... done Verifying transaction: ...working... done Executing transaction: ...working... done ✔ greta-env environment removed!
remove_miniconda() ℹ No miniconda files found at /Users/zhiyang/Library/r-miniconda install_greta_deps() ✔ greta-env environment created!
• To see full installation notes run: •greta_notes_conda_create_output()
• To see any error messages, run: •greta_notes_conda_create_error()
✔ Python modules installed!
• To see full installation notes run: •greta_notes_conda_install_output()
• To see any error messages, run: •greta_notes_conda_install_error()
✔ Installation of greta dependencies is complete! • Restart R, then load greta with:library(greta)
3. Nothing is in the .rprofile.
4. Here is the output related to `tensorflow`.
✖ Install the styler package in order to use style = TRUE
.
caught illegal operation address 0x11643c6d9, cause 'illegal opcode'
Traceback:
1: py_module_import(module, convert = convert)
2: import(module)
3: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch(import(module), error = clear_error_handler())
7: py_resolve_module_proxy(x)
8: $.python.builtin.module
(tf, "convert_to_tensor")
9: tf$convert_to_tensor
10: as_tensor.default(1)
11: NextMethod()
12: as_tensor.double(1)
13: as_tensor(1)
14: eval(expr, envir, enclos)
15: eval(expr, envir, enclos)
16: eval_with_user_handlers(expr, envir, enclos, user_handlers)
17: withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers))
18: withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)
19: doTryCatch(return(expr), name, parentenv, handler)
20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
21: tryCatchList(expr, classes, parentenv, handlers)
22: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
23: try(f, silent = TRUE)
24: handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler))
25: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval_with_user_handlers(expr, envir, enclos, user_handlers)), warning = wHandler, error = eHandler, message = mHandler)))
26: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, debug = debug, last = i == length(out), use_try = stop_on_error != 2L, keep_warning = keep_warning, keep_message = keep_message, output_handler = output_handler, include_timing = include_timing)
27: evaluate::evaluate(...)
28: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options))
29: in_dir(input_dir(), expr)
30: in_input_dir(evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), stop_on_error = if (is.numeric(options$error)) options$error else { if (options$error && options$include) 0L else 2L }, output_handler = knit_handlers(options$render, options)))
31: eng_r(options)
32: block_exec(params)
33: call_block(x)
34: process_group.block(group)
35: process_group(group)
36: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), error = function(e) { setwd(wd) cat(res, sep = "\n", file = output %n% "") message("Quitting from lines ", paste(current_lines(i), collapse = "-"), " (", knit_concord$get("infile"), ") ") })
37: process_file(text, output)
38: knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
39: rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")
40: (function (input) { rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")})(input = base::quote("prior-boa_reprex.R"))
41: (function (what, args, quote = FALSE, envir = parent.frame()) { if (!is.list(args)) stop("second argument must be a list") if (quote) args <- lapply(args, enquote) .Internal(do.call(what, args, envir))})(base::quote(function (input) { rmarkdown::render(input, quiet = TRUE, envir = globalenv(), encoding = "UTF-8")}), base::quote(list(input = "prior-boa_reprex.R")), envir = base::quote(__callr_data__
err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$`callr_dump, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$
_ignore<- list(c(1, dcframe + 1L)) e2$
_pid<- Sys.getpid() e2$
_timestamp<- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e096ada33d1", ".error")) }}, interrupt = function(e) { { callr_data <- as.environment("tools:callr")$
callr_data` err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$__callr_dump__
, envir = callr_data) rm("callr_dump__", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$_ignore
<- list(c(1, dcframe + 1L)) e2$_pid
<- Sys.getpid() e2$_timestamp
<- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e096ada33d1", ".error")) }}, callr_message = function(e) { try(signalCondition(e))})
45: doTryCatch(return(expr), name, parentenv, handler)
46: tryCatchOne(expr, names, parentenv, handlers[[1L]])
47: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
48: doTryCatch(return(expr), name, parentenv, handler)
49: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
50: tryCatchList(expr, classes, parentenv, handlers)
51: tryCatch(withCallingHandlers({ NULL saveRDS(do.call(do.call, c(readRDS("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-fun-1e093135792"), list(envir = .GlobalEnv, quote = TRUE)), envir = .GlobalEnv, quote = TRUE), file = "/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e096ada33d1") flush(stdout()) flush(stderr()) NULL invisible()}, error = function(e) { { callr_data <- as.environment("tools:callr")$`callr_data` err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$`callr_dump`, envir = callr_data) rm("__callr_dump", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$_ignore
<- list(c(1, dcframe + 1L)) e2$_pid
<- Sys.getpid() e2$_timestamp
<- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e096ada33d1", ".error")) }}, interrupt = function(e) { { callr_data <- as.environment("tools:callr")$__callr_data__
err <- callr_data$err assign(".Traceback", .traceback(4), envir = callr_data) dump.frames("callr_dump") assign(".Last.dump", .GlobalEnv$`callr_dump, envir = callr_data) rm("__callr_dump__", envir = .GlobalEnv) e$call <- deparse(conditionCall(e), nlines = 6) e2 <- err$new_error(conditionMessage(e), call. = conditionCall(e)) class(e2) <- c("callr_remote_error", class(e2)) e2$error <- e calls <- sys.calls() dcframe <- which(vapply(calls, function(x) length(x) >= 1 && identical(x[[1]], quote(do.call)), logical(1)))[1] if (!is.na(dcframe)) e2$
_ignore<- list(c(1, dcframe + 1L)) e2$
_pid<- Sys.getpid() e2$
_timestamp` <- Sys.time() if (inherits(e, "rlib_error_2_0")) e2$parent <- e$parent e2 <- err$add_trace_back(e2, embed = FALSE) saveRDS(list("error", e2), file = paste0("/var/folders/7h/6rmwx4c51mvdkn0xwlbf3tsc0000gn/T//RtmpsIwURt/callr-res-1e096ada33d1", ".error")) }}, callr_message = function(e) { try(signalCondition(e))}), error = function(e) { NULL try(stop(e))}, interrupt = function(e) { NULL e})
An irrecoverable exception occurred. R is aborting now ...
Hi @zhiiiyang - thank you so much for posting those details!
It looks like the code is failing here:
reprex::reprex({
library(tensorflow)
as_tensor(1)
},
std_out_err = TRUE,
si = TRUE
)
I would recommend posting this to https://github.com/rstudio/tensorflow/issues as it appears to be an issue with tensorflow.
Also there should be some extra code attached to the reprex examples you gave, did you remove them before posting here?
It will render like this
But will look something like this in the code:
<details style="margin-bottom:10px;">
<summary>
Session info
</summary>
``` r
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.2.0 (2022-04-22)
#> os macOS Monterey 12.3.1
#> system aarch64, darwin20
#> ui X11
#> language (EN)
#> collate en_AU.UTF-8
#> ctype en_AU.UTF-8
#> tz Australia/Perth
#> date 2022-06-08
#> pandoc 2.17.1.1 @ /Applications/RStudio.app/Contents/MacOS/quarto/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base64enc 0.1-3 2015-07-28 [1] CRAN (R 4.2.0)
#> callr 3.7.0 2021-04-20 [1] CRAN (R 4.2.0)
#> cli 3.3.0 2022-04-25 [1] CRAN (R 4.2.0)
#> coda 0.19-4 2020-09-30 [1] CRAN (R 4.2.0)
#> codetools 0.2-18 2020-11-04 [1] CRAN (R 4.2.0)
#> crayon 1.5.1 2022-03-26 [1] CRAN (R 4.2.0)
#> digest 0.6.29 2021-12-01 [1] CRAN (R 4.2.0)
#> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.2.0)
#> evaluate 0.15 2022-02-18 [1] CRAN (R 4.2.0)
#> fansi 1.0.3 2022-03-24 [1] CRAN (R 4.2.0)
#> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.2.0)
#> fs 1.5.2 2021-12-08 [1] CRAN (R 4.2.0)
#> future 1.25.0 2022-04-24 [1] CRAN (R 4.2.0)
#> globals 0.15.0 2022-05-09 [1] CRAN (R 4.2.0)
#> glue 1.6.2 2022-02-24 [1] CRAN (R 4.2.0)
#> greta 0.4.2.9000 2022-05-26 [1] local
#> here 1.0.1 2020-12-13 [1] CRAN (R 4.2.0)
#> highr 0.9 2021-04-16 [1] CRAN (R 4.2.0)
#> hms 1.1.1 2021-09-26 [1] CRAN (R 4.2.0)
#> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.2.0)
#> jsonlite 1.8.0 2022-02-22 [1] CRAN (R 4.2.0)
#> knitr 1.39 2022-04-26 [1] CRAN (R 4.2.0)
#> lattice 0.20-45 2021-09-22 [1] CRAN (R 4.2.0)
#> lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.2.0)
#> listenv 0.8.0 2019-12-05 [1] CRAN (R 4.2.0)
#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.2.0)
#> Matrix 1.4-1 2022-03-23 [1] CRAN (R 4.2.0)
#> parallelly 1.31.1 2022-04-22 [1] CRAN (R 4.2.0)
#> pillar 1.7.0 2022-02-01 [1] CRAN (R 4.2.0)
#> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.2.0)
#> png 0.1-7 2013-12-03 [1] CRAN (R 4.2.0)
#> prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.2.0)
#> processx 3.5.3 2022-03-25 [1] CRAN (R 4.2.0)
#> progress 1.2.2 2019-05-16 [1] CRAN (R 4.2.0)
#> ps 1.7.0 2022-04-23 [1] CRAN (R 4.2.0)
#> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.2.0)
#> R.cache 0.15.0 2021-04-30 [1] CRAN (R 4.2.0)
#> R.methodsS3 1.8.1 2020-08-26 [1] CRAN (R 4.2.0)
#> R.oo 1.24.0 2020-08-26 [1] CRAN (R 4.2.0)
#> R.utils 2.11.0 2021-09-26 [1] CRAN (R 4.2.0)
#> R6 2.5.1 2021-08-19 [1] CRAN (R 4.2.0)
#> Rcpp 1.0.8.3 2022-03-17 [1] CRAN (R 4.2.0)
#> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.2.0)
#> reticulate 1.24-9000 2022-05-11 [1] Github (rstudio/reticulate@451fbff)
#> rlang 1.0.2 2022-03-04 [1] CRAN (R 4.2.0)
#> rmarkdown 2.14 2022-04-25 [1] CRAN (R 4.2.0)
#> rprojroot 2.0.3 2022-04-02 [1] CRAN (R 4.2.0)
#> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.2.0)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.2.0)
#> stringi 1.7.6 2021-11-29 [1] CRAN (R 4.2.0)
#> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.2.0)
#> styler 1.7.0 2022-03-13 [1] CRAN (R 4.2.0)
#> tensorflow 2.8.0.9000 2022-05-11 [1] Github (rstudio/tensorflow@6e3e00e)
#> tfruns 1.5.0 2021-02-26 [1] CRAN (R 4.2.0)
#> tibble 3.1.7 2022-05-03 [1] CRAN (R 4.2.0)
#> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.2.0)
#> vctrs 0.4.1 2022-04-13 [1] CRAN (R 4.2.0)
#> whisker 0.4 2019-08-28 [1] CRAN (R 4.2.0)
#> withr 2.5.0 2022-03-03 [1] CRAN (R 4.2.0)
#> xfun 0.31 2022-05-10 [1] CRAN (R 4.2.0)
#> yaml 2.3.5 2022-02-21 [1] CRAN (R 4.2.0)
#>
#> [1] /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library
#>
#> ─ Python configuration ───────────────────────────────────────────────────────
#> python: /Users/nick/Library/r-miniconda-arm64/envs/greta-env/bin/python
#> libpython: /Users/nick/Library/r-miniconda-arm64/envs/greta-env/lib/libpython3.8.dylib
#> pythonhome: /Users/nick/Library/r-miniconda-arm64/envs/greta-env:/Users/nick/Library/r-miniconda-arm64/envs/greta-env
#> version: 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:05:16) [Clang 12.0.1 ]
#> numpy: /Users/nick/Library/r-miniconda-arm64/envs/greta-env/lib/python3.8/site-packages/numpy
#> numpy_version: 1.21.6
#> tensorflow: /Users/nick/Library/r-miniconda-arm64/envs/greta-env/lib/python3.8/site-packages/tensorflow
#>
#> NOTE: Python version was forced by use_python function
#>
#> ──────────────────────────────────────────────────────────────────────────────
That extra information might be useful for the team at tensorflow to help you determine how to fix this
@njtierney, thank you so much for the all help. I really appreciate it. I just filed an issue under the TensorFlow page.
@zhiiiyang no worries! I'm sorry I haven't been able to get to the bottom of things, in retrospect it would have been a better idea for me to start with checking if tensorflow works first. Hope it gets resolved! I'll keep an eye on the thread.
Hi @zhiiiyang - looking at the other thread, it looks like you are on an M1 laptop - currently greta will not work on an M1 mac - this is something we are working on right now to resolve, I'll close this issue now, but if you keep an eye on this issue: https://github.com/greta-dev/greta/issues/458 - I can keep you updated on the status of M1.
Hi, I am trying to run
greta
for the first time, I have followed the instructions but the R session crashed after runninggreta_sitrep()
.Brief description of the problem