forked from sanieldalib/Amazon-Review-Classifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_keras3.R
More file actions
58 lines (48 loc) · 1.89 KB
/
install_keras3.R
File metadata and controls
58 lines (48 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Installation script for keras3 package
# Run this script to install keras3 and its dependencies
cat("========================================\n")
cat("Installing keras3 for Neural Networks\n")
cat("========================================\n\n")
# Step 1: Fix CRAN mirror
cat("Step 1: Setting CRAN mirror...\n")
options(repos = c(CRAN = "https://cloud.r-project.org"))
cat("CRAN mirror set to: https://cloud.r-project.org\n\n")
# Step 2: Install devtools or remotes
cat("Step 2: Installing devtools/remotes...\n")
if (!require("devtools", quietly = TRUE)) {
cat("Installing devtools...\n")
install.packages("devtools", repos = "https://cloud.r-project.org")
}
if (!require("remotes", quietly = TRUE)) {
cat("Installing remotes...\n")
install.packages("remotes", repos = "https://cloud.r-project.org")
}
cat("devtools/remotes ready.\n\n")
# Step 3: Install keras3 from GitHub
cat("Step 3: Installing keras3 from GitHub...\n")
cat("This may take several minutes...\n")
if (!require("devtools", quietly = TRUE)) {
if (require("remotes", quietly = TRUE)) {
cat("Using remotes to install keras3...\n")
remotes::install_github("rstudio/keras3")
} else {
stop("Neither devtools nor remotes is available. Please install one manually.")
}
} else {
cat("Using devtools to install keras3...\n")
devtools::install_github("rstudio/keras3")
}
# Step 4: Verify installation
cat("\nStep 4: Verifying installation...\n")
if (require("keras3", quietly = TRUE)) {
cat("SUCCESS: keras3 is installed!\n")
cat("\nNext steps:\n")
cat("1. Run your neural network model scripts\n")
cat("2. TensorFlow will be automatically installed on first use\n")
} else {
cat("WARNING: keras3 installation may have failed.\n")
cat("Please check the error messages above.\n")
}
cat("\n========================================\n")
cat("Installation script complete.\n")
cat("========================================\n")