Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'r-tensorflow exists but is not a virtual environment' and 'valid installation of tensorflow not found' #589

Closed
frisew opened this issue Dec 22, 2023 · 12 comments

Comments

@frisew
Copy link

frisew commented Dec 22, 2023

I'm trying to develop a neural network model in R, and I need keras and tensorflow for that, but it seems quite difficult to actually get those libraries in R. What I currently have tried is:

  • downloaded python
  • downloaded anaconda
  • ran install_keras() and install_tensorflow() in RStudio

When I run both keras::install_keras() and tensorflow::install_tensorflow(), I get the following error:

Error in virtualenv_install(envname = envname, packages = packages, ignore_installed = pip_ignore_installed, : 'r-tensorflow' exists but is not a virtual environment

And when I run neural_network = keras_model_sequential() %>% layer_dense(units = 50, activation = "relu", input_shape = ncol(x)) %>% layer_dropout(rate = 0.4) %>% layer_dense(units = 1), I get

Error: Valid installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
C:\Users\alex\anaconda3\python.exe

Python exception encountered:
Traceback (most recent call last):
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'tensorflow'

You can install TensorFlow using the install_tensorflow() function.

Could someone help me please?

@t-kalinowski
Copy link
Member

t-kalinowski commented Dec 22, 2023

Can you please install a non-conda build of Python? You can run reticulate::install_python("3.10:latest") or download directly from www.python.org/downloads. (please install version < 3.12 for use with the current version of TensorFlow)

Once you've install Python, please try running install_keras() or install_tensorflow() again.

@frisew
Copy link
Author

frisew commented Dec 22, 2023

i tried reticulate::install_python("3.10:latest") and then install_tensorflow() but it gives this errow when i run tf_config()

2023-12-22 23:38:27.591939: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
Valid installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
C:\Users\alex\anaconda3\python.exe

Python exception encountered:
Traceback (most recent call last):
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_init
.py", line 48, in
from tensorflow._api.v2 import internal
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_api\v2_internal
_init
.py", line 11, in
from tensorflow._api.v2.internal import distribute
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_api\v2_internal
\distribute_init
.py", line 8, in
from tensorflow._api.v2.internal.distribute import combinations
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_api\v2_internal
\distribute\combinations_init
.py", line 8, in
from tensorflow.python.distribute.combinations import env # line: 456
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON1\Lib\site-packages\tensorflow\python\distribute\combinations.py", line 35, in
from tensorflow.python.distribute import multi_process_runner
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON
1\Lib\site-packages\tensorflow\python\distribute\multi_process_runner.py", line 35, in
from tensorflow.python.distribute import multi_process_lib
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON1\Lib\site-packages\tensorflow\python\distribute\multi_process_lib.py", line 25, in
from tensorflow.python.eager import test
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON
1\Lib\site-packages\tensorflow\python\eager\test.py", line 18, in
from tensorflow.python.platform import test as _test
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON1\Lib\site-packages\tensorflow\python\platform\test.py", line 20, in
from unittest import mock
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON
1\Lib\unittest\mock.py", line 26, in
import asyncio
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\asyncio_init
.py", line 25, in
all = (base_events.all +
^^^^^^^^^^^
NameError: name 'base_events' is not defined

         You can install TensorFlow using the install_tensorflow() function.

@t-kalinowski
Copy link
Member

The output indicates that reticulate is still selecting the Anaconda build of Python. This shouldn't happen under normal circumstances.

Can you please post the full output from running:

reticulate::install_python("3.10:latest")
tensorflow::install_tensorflow()

@frisew
Copy link
Author

frisew commented Dec 22, 2023

okay, this is what i get

reticulate::install_python("3.10:latest")

  • "C:/Users/alex/AppData/Local/r-reticulate/r-reticulate/pyenv/pyenv-win/bin/pyenv" install 3.10.11
    :: [Info] :: Mirror: https://www.python.org/ftp/python
    [1] "C:/Users/alex/AppData/Local/r-reticulate/r-reticulate/pyenv/pyenv-win/versions/3.10.11/python.exe"

tensorflow::install_tensorflow()
Virtual environment "r-tensorflow" removed.
Using Python: C:/Users/alex/AppData/Local/r-reticulate/r-reticulate/pyenv/pyenv-win/versions/3.9.13/python.exe
Creating virtual environment "r-tensorflow" ...

  • "C:/Users/alex/AppData/Local/r-reticulate/r-reticulate/pyenv/pyenv-win/versions/3.9.13/python.exe" -m venv "C:/Users/alex/OneDrive/Documenten/.virtualenvs/r-tensorflow"
    Done!
    Installing packages: pip, wheel, setuptools
  • "C:/Users/alex/OneDrive/Documenten/.virtualenvs/r-tensorflow/Scripts/python.exe" -m pip install --upgrade pip wheel setuptools
    Requirement already satisfied: pip in c:\users\alex\onedrive\documenten.virtualenvs\r-tensorflow\lib\site-packages (22.0.4)
    Collecting pip
    Using cached pip-23.3.2-py3-none-any.whl (2.1 MB)
    Collecting wheel
    Using cached wheel-0.42.0-py3-none-any.whl (65 kB)
    Requirement already satisfied: setuptools in c:\users\alex\onedrive\documenten.virtualenvs\r-tensorflow\lib\site-packages (58.1.0)
    Collecting setuptools
    Using cached setuptools-69.0.2-py3-none-any.whl (819 kB)
    Installing collected packages: wheel, setuptools, pip
    Attempting uninstall: setuptools
    Found existing installation: setuptools 58.1.0
    Uninstalling setuptools-58.1.0:
    Successfully uninstalled setuptools-58.1.0
    Attempting uninstall: pip
    Found existing installation: pip 22.0.4
    Uninstalling pip-22.0.4:
    Successfully uninstalled pip-22.0.4
    Successfully installed pip-23.3.2 setuptools-69.0.2 wheel-0.42.0
    Virtual environment 'r-tensorflow' successfully created.
    Using virtual environment "r-tensorflow" ...
  • "C:/Users/alex/OneDrive/Documenten/.virtualenvs/r-tensorflow/Scripts/python.exe" -m pip install --upgrade --no-user "tensorflow==2.14."
    Collecting tensorflow==2.14.

    Using cached tensorflow-2.14.1-cp39-cp39-win_amd64.whl.metadata (3.3 kB)
    Collecting tensorflow-intel==2.14.1 (from tensorflow==2.14.)
    Using cached tensorflow_intel-2.14.1-cp39-cp39-win_amd64.whl.metadata (4.8 kB)
    Collecting absl-py>=1.0.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached absl_py-2.0.0-py3-none-any.whl.metadata (2.3 kB)
    Collecting astunparse>=1.6.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
    Collecting flatbuffers>=23.5.26 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached flatbuffers-23.5.26-py2.py3-none-any.whl.metadata (850 bytes)
    Collecting gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached gast-0.5.4-py3-none-any.whl (19 kB)
    Collecting google-pasta>=0.1.1 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
    Collecting h5py>=2.9.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached h5py-3.10.0-cp39-cp39-win_amd64.whl.metadata (2.5 kB)
    Collecting libclang>=13.0.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached libclang-16.0.6-py2.py3-none-win_amd64.whl.metadata (5.3 kB)
    Collecting ml-dtypes==0.2.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached ml_dtypes-0.2.0-cp39-cp39-win_amd64.whl.metadata (20 kB)
    Collecting numpy<2.0.0,>=1.23.5 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached numpy-1.26.2-cp39-cp39-win_amd64.whl.metadata (61 kB)
    Collecting opt-einsum>=2.3.2 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
    Collecting packaging (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
    Collecting protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached protobuf-4.25.1-cp39-cp39-win_amd64.whl.metadata (541 bytes)
    Requirement already satisfied: setuptools in c:\users\alex\onedrive\documenten.virtualenvs\r-tensorflow\lib\site-packages (from tensorflow-intel==2.14.1->tensorflow==2.14.
    ) (69.0.2)
    Collecting six>=1.12.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
    Collecting termcolor>=1.1.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached termcolor-2.4.0-py3-none-any.whl.metadata (6.1 kB)
    Collecting typing-extensions>=3.6.6 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached typing_extensions-4.9.0-py3-none-any.whl.metadata (3.0 kB)
    Collecting wrapt<1.15,>=1.11.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached wrapt-1.14.1-cp39-cp39-win_amd64.whl (35 kB)
    Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached tensorflow_io_gcs_filesystem-0.31.0-cp39-cp39-win_amd64.whl (1.5 MB)
    Collecting grpcio<2.0,>=1.24.3 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached grpcio-1.60.0-cp39-cp39-win_amd64.whl.metadata (4.2 kB)
    Collecting tensorboard<2.15,>=2.14 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached tensorboard-2.14.1-py3-none-any.whl.metadata (1.7 kB)
    Collecting tensorflow-estimator<2.15,>=2.14.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached tensorflow_estimator-2.14.0-py2.py3-none-any.whl.metadata (1.3 kB)
    Collecting keras<2.15,>=2.14.0 (from tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached keras-2.14.0-py3-none-any.whl.metadata (2.4 kB)
    Requirement already satisfied: wheel<1.0,>=0.23.0 in c:\users\alex\onedrive\documenten.virtualenvs\r-tensorflow\lib\site-packages (from astunparse>=1.6.0->tensorflow-intel==2.14.1->tensorflow==2.14.
    ) (0.42.0)
    Collecting google-auth<3,>=1.6.3 (from tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached google_auth-2.25.2-py2.py3-none-any.whl.metadata (4.7 kB)
    Collecting google-auth-oauthlib<1.1,>=0.5 (from tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached google_auth_oauthlib-1.0.0-py2.py3-none-any.whl (18 kB)
    Collecting markdown>=2.6.8 (from tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached Markdown-3.5.1-py3-none-any.whl.metadata (7.1 kB)
    Collecting requests<3,>=2.21.0 (from tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
    Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached tensorboard_data_server-0.7.2-py3-none-any.whl.metadata (1.1 kB)
    Collecting werkzeug>=1.0.1 (from tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached werkzeug-3.0.1-py3-none-any.whl.metadata (4.1 kB)
    Collecting cachetools<6.0,>=2.0.0 (from google-auth<3,>=1.6.3->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached cachetools-5.3.2-py3-none-any.whl.metadata (5.2 kB)
    Collecting pyasn1-modules>=0.2.1 (from google-auth<3,>=1.6.3->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached pyasn1_modules-0.3.0-py2.py3-none-any.whl (181 kB)
    Collecting rsa<5,>=3.1.4 (from google-auth<3,>=1.6.3->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached rsa-4.9-py3-none-any.whl (34 kB)
    Collecting requests-oauthlib>=0.7.0 (from google-auth-oauthlib<1.1,>=0.5->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
    Collecting importlib-metadata>=4.4 (from markdown>=2.6.8->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached importlib_metadata-7.0.1-py3-none-any.whl.metadata (4.9 kB)
    Collecting charset-normalizer<4,>=2 (from requests<3,>=2.21.0->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl.metadata (34 kB)
    Collecting idna<4,>=2.5 (from requests<3,>=2.21.0->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached idna-3.6-py3-none-any.whl.metadata (9.9 kB)
    Collecting urllib3<3,>=1.21.1 (from requests<3,>=2.21.0->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB)
    Collecting certifi>=2017.4.17 (from requests<3,>=2.21.0->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached certifi-2023.11.17-py3-none-any.whl.metadata (2.2 kB)
    Collecting MarkupSafe>=2.1.1 (from werkzeug>=1.0.1->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl.metadata (3.1 kB)
    Collecting zipp>=0.5 (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.)
    Using cached zipp-3.17.0-py3-none-any.whl.metadata (3.7 kB)
    Collecting pyasn1<0.6.0,>=0.4.6 (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.
    )
    Using cached pyasn1-0.5.1-py2.py3-none-any.whl.metadata (8.6 kB)
    Collecting oauthlib>=3.0.0 (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard<2.15,>=2.14->tensorflow-intel==2.14.1->tensorflow==2.14.*)
    Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
    Using cached tensorflow-2.14.1-cp39-cp39-win_amd64.whl (2.1 kB)
    Using cached tensorflow_intel-2.14.1-cp39-cp39-win_amd64.whl (284.1 MB)
    Using cached ml_dtypes-0.2.0-cp39-cp39-win_amd64.whl (938 kB)
    Using cached absl_py-2.0.0-py3-none-any.whl (130 kB)
    Using cached flatbuffers-23.5.26-py2.py3-none-any.whl (26 kB)
    Using cached grpcio-1.60.0-cp39-cp39-win_amd64.whl (3.7 MB)
    Using cached h5py-3.10.0-cp39-cp39-win_amd64.whl (2.7 MB)
    Using cached keras-2.14.0-py3-none-any.whl (1.7 MB)
    Using cached libclang-16.0.6-py2.py3-none-win_amd64.whl (24.4 MB)
    Using cached numpy-1.26.2-cp39-cp39-win_amd64.whl (15.8 MB)
    Using cached protobuf-4.25.1-cp39-cp39-win_amd64.whl (413 kB)
    Using cached tensorboard-2.14.1-py3-none-any.whl (5.5 MB)
    Using cached tensorflow_estimator-2.14.0-py2.py3-none-any.whl (440 kB)
    Using cached termcolor-2.4.0-py3-none-any.whl (7.7 kB)
    Using cached typing_extensions-4.9.0-py3-none-any.whl (32 kB)
    Using cached packaging-23.2-py3-none-any.whl (53 kB)
    Using cached google_auth-2.25.2-py2.py3-none-any.whl (184 kB)
    Using cached Markdown-3.5.1-py3-none-any.whl (102 kB)
    Using cached requests-2.31.0-py3-none-any.whl (62 kB)
    Using cached tensorboard_data_server-0.7.2-py3-none-any.whl (2.4 kB)
    Using cached werkzeug-3.0.1-py3-none-any.whl (226 kB)
    Using cached cachetools-5.3.2-py3-none-any.whl (9.3 kB)
    Using cached certifi-2023.11.17-py3-none-any.whl (162 kB)
    Using cached charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl (100 kB)
    Using cached idna-3.6-py3-none-any.whl (61 kB)
    Using cached importlib_metadata-7.0.1-py3-none-any.whl (23 kB)
    Using cached MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl (17 kB)
    Using cached urllib3-2.1.0-py3-none-any.whl (104 kB)
    Using cached pyasn1-0.5.1-py2.py3-none-any.whl (84 kB)
    Using cached zipp-3.17.0-py3-none-any.whl (7.4 kB)
    Installing collected packages: libclang, flatbuffers, zipp, wrapt, urllib3, typing-extensions, termcolor, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard-data-server, six, pyasn1, protobuf, packaging, oauthlib, numpy, MarkupSafe, keras, idna, grpcio, gast, charset-normalizer, certifi, cachetools, absl-py, werkzeug, rsa, requests, pyasn1-modules, opt-einsum, ml-dtypes, importlib-metadata, h5py, google-pasta, astunparse, requests-oauthlib, markdown, google-auth, google-auth-oauthlib, tensorboard, tensorflow-intel, tensorflow
    Successfully installed MarkupSafe-2.1.3 absl-py-2.0.0 astunparse-1.6.3 cachetools-5.3.2 certifi-2023.11.17 charset-normalizer-3.3.2 flatbuffers-23.5.26 gast-0.5.4 google-auth-2.25.2 google-auth-oauthlib-1.0.0 google-pasta-0.2.0 grpcio-1.60.0 h5py-3.10.0 idna-3.6 importlib-metadata-7.0.1 keras-2.14.0 libclang-16.0.6 markdown-3.5.1 ml-dtypes-0.2.0 numpy-1.26.2 oauthlib-3.2.2 opt-einsum-3.3.0 packaging-23.2 protobuf-4.25.1 pyasn1-0.5.1 pyasn1-modules-0.3.0 requests-2.31.0 requests-oauthlib-1.3.1 rsa-4.9 six-1.16.0 tensorboard-2.14.1 tensorboard-data-server-0.7.2 tensorflow-2.14.1 tensorflow-estimator-2.14.0 tensorflow-intel-2.14.1 tensorflow-io-gcs-filesystem-0.31.0 termcolor-2.4.0 typing-extensions-4.9.0 urllib3-2.1.0 werkzeug-3.0.1 wrapt-1.14.1 zipp-3.17.0

Installation complete.

Restarting R session...

@frisew
Copy link
Author

frisew commented Dec 22, 2023

could you possibly help me out sir? and/or do you need more information?

@t-kalinowski
Copy link
Member

That looks like installation was completely successful. Do you still an error when initializing TensorFlow?
What is the output from:

tensorflow::tf_config()

@frisew
Copy link
Author

frisew commented Dec 22, 2023

when i run tensorflow::tf_config() i get

tensorflow::tf_config()
Valid installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
C:\Users\alex\anaconda3\python.exe

Python exception encountered:
Traceback (most recent call last):
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_init
.py", line 48, in
from tensorflow._api.v2 import internal
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_api\v2_internal
_init
.py", line 11, in
from tensorflow._api.v2.internal import distribute
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_api\v2_internal
\distribute_init
.py", line 8, in
from tensorflow._api.v2.internal.distribute import combinations
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\site-packages\tensorflow_api\v2_internal
\distribute\combinations_init
.py", line 8, in
from tensorflow.python.distribute.combinations import env # line: 456
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON1\Lib\site-packages\tensorflow\python\distribute\combinations.py", line 35, in
from tensorflow.python.distribute import multi_process_runner
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON
1\Lib\site-packages\tensorflow\python\distribute\multi_process_runner.py", line 35, in
from tensorflow.python.distribute import multi_process_lib
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON1\Lib\site-packages\tensorflow\python\distribute\multi_process_lib.py", line 25, in
from tensorflow.python.eager import test
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON
1\Lib\site-packages\tensorflow\python\eager\test.py", line 18, in
from tensorflow.python.platform import test as _test
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON1\Lib\site-packages\tensorflow\python\platform\test.py", line 20, in
from unittest import mock
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in _hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON
1\Lib\unittest\mock.py", line 26, in
import asyncio
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 119, in _find_and_load_hook
return _run_hook(name, _hook)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
^^^^^^
File "C:\Users\alex\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 117, in hook
return find_and_load(name, import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\alex\ANACON~1\Lib\asyncio_init
.py", line 25, in
all = (base_events.all +
^^^^^^^^^^^
NameError: name 'base_events' is not defined

         You can install TensorFlow using the install_tensorflow() function.

@frisew
Copy link
Author

frisew commented Dec 22, 2023

i think this problem is impossible to solve

@t-kalinowski
Copy link
Member

What version of reticulate are you on? I suspect this might be a bug that was fixed in the latest release of reticulate.

@frisew
Copy link
Author

frisew commented Dec 22, 2023

when i run packageVersion("reticulate") it says ‘1.32.0’

@t-kalinowski
Copy link
Member

The current release is 1.34. Can you update?

@frisew
Copy link
Author

frisew commented Dec 23, 2023

i ran install.packages("reticulate", repos = "https://cran.r-project.org", dependencies = TRUE) and my neural network seems to work now, thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants