原文链接: conda tf2 gpu 安装
上一篇: js 快速排序递归实现
下一篇: js 原型链污染和预防
安装
conda create -n TF_2G python=3.6 anaconda
激活环境
conda activate TF_2G
安装
conda install cudatoolkit=10.0 cudnn
pip install tensorflow-gpu==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
测试
import tensorflow as tf
X = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
y = tf.constant([[10.0], [20.0]])
class Linear(tf.keras.Model):
def __init__(self):
super().__init__()
self.dense = tf.keras.layers.Dense(
units=1,
activa