[R-sig-Debian] how to install R 4.4
Dirk Eddelbuettel
edd @end|ng |rom deb|@n@org
Sat May 17 10:14:57 CEST 2025
Stephen,
On 16 May 2025 at 14:33, Stephen Bond wrote:
| Dirk,
|
| I appreciate your help. Please, tell me what folders R installs into. I
| have a good working 4.3 on another box and want to copy over the 4.5 as
| this is my fastest box and it is a shame not to use it.
That may be doable as a hack, but it is not recommended. See if an "apt
repackaging helper" exists.
| If you want to check your install of keras on 4.5 please, run the code
| below and confirm if it works and report on github. It should take
| under 1min.
I am traveling a continent over, and am a little pressed for time (and may
not have reticulate setup on the laptop I travel with). And as I mentioned,
this thread is getting a little astray of the initial question.
You work for one of the country's largest corporations, maybe your IT
department can help you with your particular need? The reticulate help at
the GH repo is also good (many old questions you can search).
Good luck, Dirk
| I started an issue here:
| https://github.com/rstudio/tensorflow.rstudio.com/issues/80
|
| ```
| library(keras)
|
| imdb <- dataset_imdb(num_words = 10001)
| train_data <- imdb$train$x
| train_labels <- imdb$train$y
| test_data <- imdb$test$x
| test_labels <- imdb$test$y
|
| vector2 <- function(sequences, dimension = 10000){
| results <- array(0, dim = c(length(sequences), dimension))
| for(i in seq_along(sequences)){
| results[i,sequences[[i]]] <- 1
| }
| results
| }
|
| X <- vector2(train_data)
| Xt <- vector2(test_data)
| y <- as.numeric(train_labels)
| yt <- as.numeric(test_labels)
| Xv <- X[1:10000, ]
| Xp <- X[-(1:10000), ]
| yv <- y[seq(10000)]
| yp <- y[-seq(10000)]
|
| model <- keras_model_sequential() %>%
| layer_dense(16, activation = "relu") %>%
| layer_dense(16, activation = "relu") %>%
| layer_dense(1, activation = "sigmoid")
|
|
| model %>% compile(optimizer = "rmsprop",
| loss = "binary_crossentropy",
| metrics = "accuracy")
|
|
| history <- model %>% fit( Xp, yp, epochs = 20, batch_size = 512,
| validation_data = list(Xv, yv)
| )
| ```
|
| On Wed, 2025-05-14 at 17:20 -0500, Dirk Eddelbuettel wrote:
| > >
| > > Stephen,
| > >
| > > Sorry to hear that. I am not sure that hijacking an existing thread
| > > > here is
| > > the best idea -- this is now also deep into reticulate territory, >
| > > will depend
| > > on how you run Python on the box and more. For what it is worth, >
| > > still works
| > > here
| > >
| > > > library("keras")
| > > > library("tensorflow")
| > > > search()
| > > [1] ".GlobalEnv" "package:tensorflow" >
| > > "package:keras"
| > > [4] "ESSR" "package:stats" >
| > > "package:graphics"
| > > [7] "package:grDevices" "package:utils" >
| > > "package:datasets"
| > > [10] "package:methods" "Autoloads" >
| > > "package:base"
| > > >
| > >
| > > Might be best start over with 'reticulate 101', ie whether you can
| > > > access
| > > Python, test whether you can load the required packages in your >
| > > Python
| > > session and so on.
| > >
| > > Good luck, Dirk
| > >
|
--
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
More information about the R-SIG-Debian
mailing list