You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Win10下R环境中TensorFlow/Keras GPU版本安装报错求助

Alright, let's work through this step by step to get TensorFlow/Keras GPU version up and running on your Win10 system with the Nvidia GeForce MX150. I’ve tackled similar issues before, so here’s a structured approach to fix both the AVX2 warning and the conda installation error:

1. First, Confirm GPU Compatibility & Update Nvidia Drivers

The MX150 supports CUDA, but we need to stick to TensorFlow versions that work with its compute capability (6.1). Newer TF versions (2.11+) dropped support for older GPUs like yours, so we’ll target TensorFlow 2.10 GPU—it’s the last compatible build.

  • Download and install the latest stable Nvidia driver for MX150 (skip this if you already have up-to-date drivers). Reboot your system after installation to apply changes.
2. Install Matching CUDA Toolkit & cuDNN

TensorFlow GPU relies on CUDA and cuDNN, and their versions must align perfectly with the TF version we’re using. For TF 2.10:

  • CUDA Toolkit 11.2: Download and install this specific version (not the latest). Choose the "Custom" installation option and ensure all CUDA-related components (Runtime, Development Tools) are checked.
  • cuDNN 8.1.0 for CUDA 11.2: Grab this from Nvidia’s developer portal (you’ll need a free account to download). Extract the zip file, then copy the bin, include, and lib folders into your CUDA installation directory (usually C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2).
3. Set Up Environment Variables (Critical Step!)

Windows needs to know where CUDA and cuDNN are located:

  1. Open System Properties > Advanced > Environment Variables.
  2. Under System Variables:
    • Add a new variable CUDA_PATH with the value C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2
    • Add another variable CUDNN_PATH with the same value as above
    • Edit the Path variable and add these entries:
      • %CUDA_PATH%\bin
      • %CUDA_PATH%\libnvvp
      • %CUDNN_PATH%\bin
  3. Reboot your PC to make sure these variables take effect.
4. Clean Up the Old Conda Environment

The existing r-tensorflow environment might have conflicts, so let’s wipe it first:

library(reticulate)
conda_remove(envname = "r-tensorflow")

If this throws an error, you can manually delete the environment folder at C:\Users\[Your Username]\.conda\envs\r-tensorflow.

5. Install TensorFlow GPU in R (With the Right Version)

Now install the compatible GPU build using conda:

library(tensorflow)
install_tensorflow(version = "2.10-gpu", envname = "r-tensorflow", method = "conda")
  • The 2.10-gpu tag ensures we get the GPU-optimized version that works with your MX150.
  • Specifying method = "conda" ensures we use a clean conda environment.
6. Verify the Installation

Once installation finishes, test if TensorFlow recognizes your GPU:

library(tensorflow)
tf$config$list_physical_devices("GPU")

If you see an entry for your MX150, you’re all set! You can also test Keras quickly:

library(keras)
test_model <- keras_model_sequential() %>%
  layer_dense(units = 8, input_shape = c(8))

If this runs without errors, the GPU version is working correctly.

Fixing the "Error 1" Installation Issue

If you still hit that error during installation, try these fixes:

  • Run R/RStudio as Administrator: Permission issues often block conda from installing packages. Right-click RStudio and select "Run as administrator" before running the install command.
  • Check Conda Installation: Make sure conda is in your system PATH. Open Command Prompt and run conda --version—if it’s not recognized, install Miniconda (64-bit) and ensure you check the "Add to PATH" option during setup.
  • Clear Conda Cache: Open Command Prompt and run conda clean --all to delete cached packages, then retry the R installation command.
  • Disable Antivirus Temporarily: Some antivirus tools block conda’s package downloads. Turn it off briefly during installation, then re-enable it.
What About the AVX2 Warning?

Once you switch to the GPU version, this warning should disappear automatically—TensorFlow will prioritize using your MX150 over the CPU. If it still pops up, you can suppress it with this line at the start of your scripts:

library(tensorflow)
tf$compat$v1$logging$set_verbosity(tf$compat$v1$logging$ERROR)

内容的提问来源于stack exchange,提问作者Grec001

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 07:56:11