环境:

  • 显卡:GTX 780Ti
  • VS:2019

主要参考:Installation Guide Windows :: CUDA Toolkit Documentation (nvidia.com)

怎么弄?

其实非常简单,就两步

  1. 下载安装 CUDA Toolkit (体积较大)。装完重启,环境变量生效。
  2. pip 安装 Python 相关依赖包。

下面这个脚本供测试:

import numpy as np
import pandas as pd

from sklearn import datasets
from sklearn.model_selection import KFold, train_test_split, cross_val_score, cross_validate
from sklearn import svm, tree

import tensorflow as tf

iris = datasets.load_iris()
X = pd.DataFrame(iris['data'], columns=iris['feature_names'])

y = pd.Series(iris['target_names'][iris['target']])
# y = pd.get_dummies(y)

print(X.head())