Python Tensorflow gpu在基本文本分类中不工作
我有Python Tensorflow gpu在基本文本分类中不工作,python,tensorflow,keras,Python,Tensorflow,Keras,我有 tensorflow==2.3.0 tensorflow gpu==2.3.0 CUDA==10.1 cuDNN==7.6.5 我试着按照这个例子训练一个神经网络 为了启用GPU,我添加了以下代码 config = tf.compat.v1.ConfigProto() config.gpu_options.allow_growth = True session = tf.compat.v1.Session(config=config) 就在之前 model = keras.Seque
tensorflow==2.3.0代码>
tensorflow gpu==2.3.0
CUDA==10.1
cuDNN==7.6.5
config = tf.compat.v1.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.compat.v1.Session(config=config)
就在之前
model = keras.Sequential([
keras.layers.Flatten(input_shape=(28, 28)),
keras.layers.Dense(128, activation='relu'),
keras.layers.Dense(10, activation='softmax')
])
在本例中,GPU正在工作!但在另一个例子中
当我在之前添加会话连接时
model = tf.keras.Sequential([
layers.Embedding(max_features + 1, embedding_dim),
layers.Dropout(0.2),
layers.GlobalAveragePooling1D(),
layers.Dropout(0.2),
layers.Dense(1)])
GPU不工作
对于第二个示例,我需要做什么才能获得GPU?什么是“GPU不工作”?你是怎么确定的?你怎么能说GPU不工作了?我的意思是视频卡不是用来训练神经网络的。