|
4 | 4 | #' these are TF 2.15.0, TFP 0.23.0, and Python 3.10. These Python modules
|
5 | 5 | #' will be installed into a conda environment named "greta-env-tf2".
|
6 | 6 | #'
|
7 |
| -#' To see install notes or errors, there isn't an argument to specify, |
| 7 | +#' To see installation notes or errors, there isn't an argument to specify, |
8 | 8 | #' instead you will need to specify and environment variable,
|
9 | 9 | #' `GRETA_INSTALLATION_LOG`, with
|
10 | 10 | #' `Sys.setenv('GRETA_INSTALLATION_LOG'='path/to/logfile.html')`. Or use
|
11 | 11 | #' [greta_set_install_logfile()] to set the path, e.g.,
|
12 | 12 | #' `greta_set_install_logfile('path/to/logfile.html')`. You can also skip
|
13 |
| -#' the restarting of R and use [write_greta_install_log()], which |
14 |
| -#' installation notes will indicate how to use if you haven't specified. |
| 13 | +#' the restarting of R and use [write_greta_install_log()]. If you have |
| 14 | +#' not specified the `GRETA_INSTALLATION_LOG` environmental variable, the |
| 15 | +#' installation notes will indicate how to use [write_greta_install_log()]. |
15 | 16 | #'
|
16 | 17 | #' @param python_deps object created with [greta_python_deps()] where you
|
17 | 18 | #' specify python, TF, and TFP versions. By default these are TF 2.15.0,
|
|
42 | 43 | #' package versions, and forcibly switch over to using that conda environment.
|
43 | 44 | #'
|
44 | 45 | #' If you don't want to use conda or the "greta-env-tf2" conda environment, you
|
45 |
| -#' can install these specific versions of tensorflow (version 2.6.0), and |
46 |
| -#' tensorflow-probability (version 0.14.1), and ensure that the python |
47 |
| -#' environment that is initialised in this R session has these versions |
48 |
| -#' installed. This is now always straightforward, so we recommend installing |
| 46 | +#' can install versions that you like, e.g., using [reticulate::py_install()]. |
| 47 | +#' If you want to see which versions of TF, TFP, and Python work with each |
| 48 | +#' other (at least according to information from tensorflows website), see the |
| 49 | +#' data `greta_deps_tf_tfp`, which is provided with greta. Managing your own |
| 50 | +#' installation is not always straightforward, so we recommend installing |
49 | 51 | #' the python packages using `install_greta_deps()` for most users.
|
50 | 52 | #'
|
51 | 53 | #' @name install_greta_deps
|
@@ -201,17 +203,44 @@ restart_or_not <- function(restart){
|
201 | 203 |
|
202 | 204 | #' Specify python dependencies for greta
|
203 | 205 | #'
|
204 |
| -#' A helper function for specifying versions of Tensorflow (TF), Tensorflow Probability (TFP), and Python. |
| 206 | +#' A helper function for specifying versions of Tensorflow (TF), Tensorflow |
| 207 | +#' Probability (TFP), and Python. Defaulting to 2.15.0, 0.23.0, and 3.10. |
| 208 | +#' You can specify the version that you want to install, but it will check |
| 209 | +#' if these are compatible. That is, if you specify versions of TF/TFP/Python |
| 210 | +#' which do not work with each other, it will error and give a suggested |
| 211 | +#' version to install. It does this by using a dataset, `greta_deps_tf_tfp`, |
| 212 | +#' to check if the versions of TF, TFP, and Python specified are compatible |
| 213 | +#' on your operating system. You can inspect this dataset with |
| 214 | +#' `View(greta_deps_tf_tfp)`. |
205 | 215 | #'
|
206 |
| -#' @param tf_version Character. Tensorflow (TF) version in format major.minor.patch. Default is "2.15.0". |
207 |
| -#' @param tfp_version Character.Tensorflow probability (TFP) version major.minor.patch. Default is "0.23.0". |
208 |
| -#' @param python_version Character. Python version in format major.minor.patch. Default is "3.10". |
| 216 | +#' @param tf_version Character. Tensorflow (TF) version in format |
| 217 | +#' major.minor.patch. Default is "2.15.0". |
| 218 | +#' @param tfp_version Character.Tensorflow probability (TFP) version |
| 219 | +#' major.minor.patch. Default is "0.23.0". |
| 220 | +#' @param python_version Character. Python version in format major.minor.patch. |
| 221 | +#' Default is "3.10". |
209 | 222 | #'
|
210 |
| -#' @return list of dependencies |
| 223 | +#' @return data frame of valid dependencies |
211 | 224 | #' @export
|
212 | 225 | #'
|
213 | 226 | #' @examples
|
214 | 227 | #' greta_python_deps()
|
| 228 | +#' greta_python_deps(tf_version = "2.15.0") |
| 229 | +#' greta_python_deps(tf_version = "2.15.0", tfp_version = "0.23.0") |
| 230 | +#' greta_python_deps(tf_version = "2.15.0", python_version = "3.10") |
| 231 | +#' greta_python_deps( |
| 232 | +#' tf_version = "2.15.0", |
| 233 | +#' tfp_version = "0.23.0", |
| 234 | +#' python_version = "3.10" |
| 235 | +#' ) |
| 236 | +#' # this will fail |
| 237 | +#' \dontrun{ |
| 238 | +#' greta_python_deps( |
| 239 | +#' tf_version = "2.11.0", |
| 240 | +#' tfp_version = "0.23.0", |
| 241 | +#' python_version = "3.10" |
| 242 | +#' ) |
| 243 | +#' } |
215 | 244 | greta_python_deps <- function(tf_version = "2.15.0",
|
216 | 245 | tfp_version = "0.23.0",
|
217 | 246 | python_version = "3.10"){
|
|
0 commit comments