拜托,我几周来在尝试在 R Studio 中安装和运行 TensorFlow 和 keras 时遇到了麻烦。我已经尝试了网上能找到的所有方法,但都无济于事。我的系统上安装了 anaconda,我需要卸载它吗?运行这行代码后:
install_tensorflow(method = "conda",version = "default", envname = "py3.6",
conda_python_version = "3.6",
extra_packages = c("matplotlib","numpy","pandas","scikit-learn"))
install_keras(method = "conda")
它说安装成功,但是当我现在运行tf$constant("Hellow Tensorflow")
时,我收到以下错误消息:
Error: Installation of TensorFlow not found.
Python environments searched for 'tensorflow' package:
C:\Users\IFEANYI\AppData\Local\r-miniconda\envs\r-reticulate\python.exe
You can install TensorFlow using the install_tensorflow() function.
我还尝试使用以下方式安装 keras:
install_keras(method = "conda")
install_keras(tensorflow = "default")
但我也收到一条错误消息:
Error in install_keras(method = "conda") :
You should call install_keras() only in a fresh R session that has not yet initialized Keras and TensorFlow (this is to avoid DLL in use errors during installation)
我还在 R Studio 中安装了 reticulate。老实说,我不知道为什么在 Windows 10 的 R 中安装和运行 TensorFlow 是一项艰巨的任务。我已经这样做了几个星期,但没有任何明显的进展。请一如既往,如果有人能帮助我解决这个棘手的问题,我将非常感激
最佳答案
最近 R 包中的安装路径发生了重大变化。您能否尝试以下操作(在新的 R session 中):
install.packages("keras")
reticulate::install_miniconda()
keras::install_keras()
如果以上方法不起作用,您可以提交问题吗:https://github.com/rstudio/keras/issues/new
关于python - 在 Windows 10 上的 R Studio 中安装和运行 Tensorflow 的噩梦,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68069190/