to_categorical function in KerasR not working - r

I am using the to_categorical function in KerasR and it throws an error message in RStudio which is this:
mnist_y <- to_categorical(mnist_y, 10)
Collecting package metadata (current_repodata.json): ...working... failed
CondaSSLError: OpenSSL appears to be unavailable on this machine. OpenSSL is required to
download and install packages.
Exception: HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /conda-forge/win-64/current_repodata.json (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
Error: Python not available
See reticulate::use_python() to set python path,
then use kerasR::keras_init() to retry
I am using R 4.2.1. Based on the error message, it seems that I have to install Python on my computer, and set the Python path? I am not an experienced user of Python.
I tried installing the package OpenSSL, but I am still getting the same error.
Any help is greatly appreciated. Many thanks.

Related

Installing error in Google Cloud using CloudML library in R

I'm trying Google Cloud for the first time for training a DNN model with using Keras in R.
The use of the cloudml_train()-function try to install a lot of libraries on the Google Cloud server, and there is an error that I can't go round:
master-replica-0 Installing BiocGenerics (0.20.0) ...
master-replica-0 curl: (22) The requested URL returned error: 404 Not Found
As I understand, it tries to install the BioGenerics library, but the path is wrong.
Any suggestion how to solve this?

Troubles installing Tensorflow for R

I'm trying to install TensorFlow for R, and up to now I've followed these steps:
devtools::install_github("rstudio/tensorflow" Worked fine
library(tensorflow)
install_tensorflow()
And at this lasts point I get this error
HTTP error 404 while getting https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp37-cp37m-linux_x86_64.whl
Could not install requirement tensorflow==1.9.0 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp37-cp37m-linux_x86_64.whl because of error 404 Client Error: Not Found for url: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp37-cp37m-linux_x86_64.whl
Could not install requirement tensorflow==1.9.0 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp37-cp37m-linux_x86_64.whl because of HTTP error 404 Client Error: Not Found for url: https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp37-cp37m-linux_x86_64.whl for URL https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp37-cp37m-linux_x86_64.whl
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Errore: Error 1 occurred installing packages into conda environment r-tensorflow
Shortly it seems R tries to install Tensorflow with installing python version 3.7 which is not currently supported by this package (only up to 3.6).
Is it possible to force install_tensorflow to use an earlier python version?
P.S. I saw there is the possibility of using virtual envs, but I'm not familiar with them.

Connection reset by peer when trying to install private Gitlab R package

I have created an R package that I have hosted in my company's Gitlab, and when I try to use the solution described here to install it I get the following error:
Installation failed: Error in 'git2r_clone': SSL error: syscall failure: Connection reset by peer
A coworker tried to run the same command I did and they managed to do it. Why is this error occurring to me?
Check your Git version and your %PATH% (Windows) or $PATH.
You must have a recent Git, for supporting the right OpenSSL version, and you must not reference any other openssl in your PATH which might be too old.

Trying to search or install a package doesn't work and gives an error

When i try to search for a package or a theme i get this error message
Searching for “package” failed. connect ETIMEDOUT
xx.xx.xxx.xx:xxx
But When i try to install a package or a theme if it the searched worked without a problem i get this error message
Installing “package#ver” failed
Request for package information failed: connect ETIMEDOUT
xx.xx.xxx.xx:xxx (5 attempts) (ETIMEDOUT)
Compiler tools not found Packages that depend on modules that contain
C/C++ code will fail to install. Read here for instructions on
installing Python and Visual Studio. Run apm install --check after
installing to test compiling a native module.

Error: could not find function "geom_sf"

I'm currently running R version 3.4.2 on Windows and have ggplot2 (via tidyverse) and sf package versions 3.4.2. I'm attempting to map spatial data using the ggplot2 sf kit.
When trying to run geom_sf, I receive an error: could not find function "geom_sf".
When I search the ggplot2 package using ls("package:ggplot2"), geom_sf is not listed in the library files.
I installed devtools and ran devtools::install_github("tidyverse/ggplot2"). However, I receive an error: Installation failed: Failed to connect to raw.githubusercontent.come port 443: Timed out. I assume the firewall at work is halting this connection.
To get around this, I tried downloading the zip manually from https://github.com/tidyverse/ggplot2 and running install.packages('ggplot2-master.zip', lib = 'C:/filepath') and receive the error: package 'ggplot2-master.zip' is not available (for R version 3.4.2). I was getting the same error before I updated from 3.4.1.
TLDR: I'm having the same issue as this user: Error when plotting sf object --- Error: could not find function "geom_sf"
but the solution does not work for me.
Does anyone see where I may be missing something? Or how to access this highly referenced (more streamlined) package?
If you downloaded from the URL you cited then the appropriate next step would be to execute this at the R session command line assuming your package is in the working directory:
install.packages('ggplot2', repo=NULL, lib = 'C:/filepath')
The .zip extension is implicit in trying to install from a binary windows file and you need to tell it NOT to attempt downloading from CRAN.

Resources