Hi, i can't manage to make tensorfow work inside Rstudio in windows 11
i have a r-tensorflow conda environment with tensorflow 2.10 working
if i use R directly without Rstudio i can load keras and tensorflow packages and it works, but when i use rstudio it does not work. The error i have is
library(tensorflow)
Error: package or namespace load failed for βtensorflowβ:
.onLoad failed in loadNamespace() for 'tensorflow', details:
call: py_module_import(module, convert = convert)
error: NameError: name 'base_events' is not defined
Runreticulate::py_last_error()
for details.
reticulate:::py_last_error()
ββ Python Exception Message βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Traceback (most recent call last):
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\site-packages\tensorflow_init.py", line 37, in
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\site-packages\tensorflow\python_init.py", line 104, in
from tensorflow.python.platform import test
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\site-packages\tensorflow\python\platform\test.py", line 20, in
from tensorflow.python.framework import test_util as _test_util
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\site-packages\tensorflow\python\framework\test_util.py", line 33, in
from absl.testing import parameterized
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\site-packages\absl\testing\parameterized.py", line 222, in
from absl.testing import absltest
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\site-packages\absl\testing\absltest.py", line 46, in
from unittest import mock # pylint: disable=unused-import Allow absltest.mock.
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\unittest\mock.py", line 26, in
import asyncio
File "C:\Users\fabie\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\fabie\AppData\Local\R\win-library\4.3\reticulate\python\rpytools\loader.py", line 93, in _run_hook
module = hook()
File "C:\Users\fabie\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\fabie\MINICO~1\envs\R-TENS~1\lib\asyncio_init.py", line 27, in
all = (base_events.all +
NameError: name 'base_events' is not defined
ββ R Traceback ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
- ββreticulate::import("tensorflow")
- ββreticulate:::py_module_import(module, convert = convert)