Closed Asromer-biology closed 1 year ago
Thank you for the bug report, I could reproduce. This was a bug in the development version of reticulate, which should be now fixed. Can you please install the latest development version and try again?
pak::pak("rstudio/reticulate", ask = FALSE)
Thank you for such a prompt reply!
Thank you for the bug report, I could reproduce. This was a bug in the development version of reticulate, which should be now fixed. Can you please install the latest development version and try again?
pak::pak("rstudio/reticulate", ask = FALSE)
I tried installing using the pak
package but got the following error
> pak::pak("rstudio/reticulate", ask = FALSE)
Error in load_private_package("glue") :
Cannot load glue from the private library
Installation of R packages can fail on Windows if the package is already loaded. This is especially tricky for packages like reticulate, or glue, since the package namespace might be loaded by the IDE.
Make sure you've quit any other sessions of Rstudio / R, and try to again. You can also try using remotes::install_github("rstudio/reticulate")
, if this is a {pak} specific bug.
That did the trick!
> model %>% compile(
+ optimizer = "adam",
+ loss = loss_fn,
+ metrics = "accuracy"
+ )
>
> model %>% fit(x_train, y_train, epochs = 5)
Epoch 1/5
1875/1875 [==============================] - 6s 3ms/step - loss: 0.0660 - accuracy: 0.9792
Epoch 2/5
1875/1875 [==============================] - 5s 3ms/step - loss: 0.0602 - accuracy: 0.9798
Epoch 3/5
1875/1875 [==============================] - 5s 3ms/step - loss: 0.0535 - accuracy: 0.9826
Epoch 4/5
1875/1875 [==============================] - 5s 3ms/step - loss: 0.0484 - accuracy: 0.9842
Epoch 5/5
1875/1875 [==============================] - 5s 3ms/step - loss: 0.0442 - accuracy: 0.9852
Diagnositic info for future reference
> reticulate::py_config()
python: C:/Users/alexr/Documents/.virtualenvs/r-tensorflow/Scripts/python.exe
libpython: C:/Users/alexr/AppData/Local/r-reticulate/r-reticulate/pyenv/pyenv-win/versions/3.9.13/python39.dll
pythonhome: C:/Users/alexr/Documents/.virtualenvs/r-tensorflow
version: 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)]
Architecture: 64bit
numpy: C:/Users/alexr/Documents/.virtualenvs/r-tensorflow/Lib/site-packages/numpy
numpy_version: 1.24.3
tensorflow: C:\Users\alexr\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\tensorflow\__init__.p
NOTE: Python version was forced by import("tensorflow")
> tensorflow::tf_config()
TensorFlow v2.13.0 (C:\Users\alexr\DOCUME~1\VIRTUA~1\R-TENS~1\lib\site-packages\tensorflow\__init__.p)
Python v3.9 (~/.virtualenvs/r-tensorflow/Scripts/python.exe)
Thank you greatly!
I've been trying to get tensorflow and keras to work in Rstudio on my system for the past several days but despite my best efforts I haven't been able to do so. I have been able to download the packages, create virtual enviroments, install packages into them via the windows command line, but still have not been able to get models to run successfully. Any assistance would be greatly appreciated.
Please provide the output of demo code for tensorflow from rstudio as well as the suggested diagnosistic outputs.
`