Python CUDA_错误_非法_地址-训练tensorflow keras模型时

Python CUDA_错误_非法_地址-训练tensorflow keras模型时,python,tensorflow,keras,Python,Tensorflow,Keras,尽管如此,也提出了类似的问题,有些问题得到了回答。尽管如此,我还是把头撞在墙上 让我从场景开始 问题: 一个简单的二元分类问题,使用TensorFlow keras。 训练数据点数~=1000000 批量大小:32 Tensorflow:2.3.2 cuda:10.1 cuDNN:7.6 GPU架构:Volta 型号的示例代码 数据点~=100万时出错 以下错误是随机发生的,有时发生在几秒钟之内 有时30分钟左右 有趣的是,当我将数据从 一百万,我没有得到任何错误 任何帮助都将不胜感激。请参阅将

尽管如此,也提出了类似的问题,有些问题得到了回答。尽管如此,我还是把头撞在墙上

让我从场景开始

问题:
一个简单的二元分类问题,使用TensorFlow keras。
训练数据点数~=1000000
批量大小:32
Tensorflow:2.3.2
cuda:10.1
cuDNN:7.6
GPU架构:Volta

型号的示例代码

数据点~=100万时出错

以下错误是随机发生的,有时发生在几秒钟之内 有时30分钟左右

有趣的是,当我将数据从 一百万,我没有得到任何错误

任何帮助都将不胜感激。

请参阅将解决您的问题。谢谢
input = tf.keras.layers.Input(shape=[],dtype=tf.string)

embedding = hub.KerasLayer(USE_embedding_url, trainable= False)(tf.squeeze(tf.cast(input_text, tf.string)))

dropout1 = tf.keras.layers.Dropout(0.25)(embedding)
dense1 = tf.keras.layers.Dense(512, activation='relu')(dropout1)

dropout2 = tf.keras.layers.Dropout(0.25)(dense1)
dense2 = tf.keras.layers.Dense(256, activation='relu')(dropout2)

dropout3 = tf.keras.layers.Dropout(0.25)(dense2)
dense3 = tf.keras.layers.Dense(128, activation='relu')(dropout3)

dropout4 = tf.keras.layers.Dropout(0.25)(dense3)

output = tf.keras.layers.Dense(1, activation='sigmoid')(dropout4)

model = tf.keras.Model(inputs=input, outputs=output, name='model')

model.compile(optimizer='Adam',
    loss='binary_crossentropy',
    metrics=['accuracy']
tensorflow/stream_executor/cuda/cuda_event.cc:29] Error polling for event status: failed to query event: CUDA_ERROR_ILLEGAL_ADDRESS: an illegal memory access was encountered
2021-04-07 15:11:25.734280: F tensorflow/core/common_runtime/gpu/gpu_event_mgr.cc:220] Unexpected Event status: 1