gpt4 book ai didi

python-3.x - 内核似乎已经死亡。它会自动重新启动。内存有问题吗?

转载 作者:行者123 更新时间:2023-11-30 09:16:10 25 4
gpt4 key购买 nike

运行一些代码后内核死亡
我尝试运行代码以使用生成器生成示例图像我尝试更新 conda 和 Jupiter,但它们都不起作用

我一直在观察 GPU 的内存使用情况,但它并没有那么多地使用 GPU

tensorflow2.0 , ubuntu 18.10, cuda 10.0
python 3.5,

def make_generator_model():
model = tf.keras.Sequential()
model.add(layers.Dense(7*7*256, use_bias=False, input_shape=(100,)))
model.add(layers.BatchNormalization())
model.add(layers.LeakyReLU())

model.add(layers.Reshape((7, 7, 256)))
assert model.output_shape == (None, 7, 7, 256) # Note: None is the batch size

model.add(layers.Conv2DTranspose(128, (5, 5), strides=(1, 1), padding='same', use_bias=False))
assert model.output_shape == (None, 7, 7, 128)
model.add(layers.BatchNormalization())
model.add(layers.LeakyReLU())

model.add(layers.Conv2DTranspose(64, (5, 5), strides=(2, 2), padding='same', use_bias=False))
assert model.output_shape == (None, 14, 14, 64)
model.add(layers.BatchNormalization())
model.add(layers.LeakyReLU())

model.add(layers.Conv2DTranspose(1, (5, 5), strides=(2, 2), padding='same', use_bias=False, activation='tanh'))
assert model.output_shape == (None, 28, 28, 1)

return model
generator = make_generator_model()

noise = tf.random.normal([1, 100])
generated_image = generator(noise, training=False)

[I 10:20:06.664 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports WARNING:root:kernel 4406ce3b-1b5b-4ef8-aba9-d5fd9ed129e7 restarted 2019-04-18 10:20:21.002451: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcuda.so.1 2019-04-18 10:20:21.081020: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1589] Found device 0 with properties: name: TITAN Xp major: 6 minor: 1 memoryClockRate(GHz): 1.582 pciBusID: 0000:42:00.0 totalMemory: 11.91GiB freeMemory: 340.69MiB 2019-04-18 10:20:21.081054: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1712] Adding visible gpu devices: 0 2019-04-18 10:20:21.081382: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA 2019-04-18 10:20:21.107510: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55de6ead0990 executing computations on platform CUDA. Devices: 2019-04-18 10:20:21.107562: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): TITAN Xp, Compute Capability 6.1 2019-04-18 10:20:21.127890: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3493050000 Hz 2019-04-18 10:20:21.129460: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55de6eed7eb0 executing computations on platform Host. Devices: 2019-04-18 10:20:21.129503: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0): , 2019-04-18 10:20:21.129616: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1712] Adding visible gpu devices: 0 2019-04-18 10:20:21.129722: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudart.so.10.0 2019-04-18 10:20:21.130785: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1120] Device interconnect StreamExecutor with strength 1 edge matrix: 2019-04-18 10:20:21.130807: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1126] 0 2019-04-18 10:20:21.130819: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1139] 0: N 2019-04-18 10:20:21.131090: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1260] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 115 MB memory) -> physical GPU (device: 0, name: TITAN Xp, pci bus id: 0000:42:00.0, compute capability: 6.1) 2019-04-18 10:20:24.168083: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcublas.so.10.0 2019-04-18 10:20:24.331094: I tensorflow/stream_executor/platform/default/dso_loader.cc:42] Successfully opened dynamic library libcudnn.so.7 2019-04-18 10:20:24.789774: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 2019-04-18 10:20:24.791468: E tensorflow/stream_executor/cuda/cuda_dnn.cc:329] Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 2019-04-18 10:20:24.791484: F tensorflow/core/kernels/conv_grad_input_ops.cc:949] Check failed: stream->parent()->GetConvolveBackwardDataAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo(stream->parent()), &algorithms) [I 10:20:27.669 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports WARNING:root:kernel 4406ce3b-1b5b-4ef8-aba9-d5fd9ed129e7 restarted

最佳答案

根据错误的输出,似乎是内存问题。

“总内存:11.91GiB 可用内存:340.69MiB”

尝试重新启动您的电脑,并在重新启动后立即查看有多少 RAM 可用,然后再次执行您的代码并查看是否有效。

关于python-3.x - 内核似乎已经死亡。它会自动重新启动。内存有问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55737980/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com