[R-sig-Debian] how to install R 4.4
Stephen Bond
@tephen@cbond @end|ng |rom y@hoo@com
Fri May 16 20:33:28 CEST 2025
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.
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 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
> >
More information about the R-SIG-Debian
mailing list