Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在为图像着色准备数据时,colab中的会话崩溃_Python_Tensorflow_Keras_Deep Learning_Tensorflow2.0 - Fatal编程技术网

Python 在为图像着色准备数据时,colab中的会话崩溃

Python 在为图像着色准备数据时,colab中的会话崩溃,python,tensorflow,keras,deep-learning,tensorflow2.0,Python,Tensorflow,Keras,Deep Learning,Tensorflow2.0,当我尝试对5000张图像执行rgb到实验室操作时,如下所示: import cv2 X =[] Y =[] for img in img_arr: X.append(img[:,:,0]) Y.append(img[:,:,1:] / 128) #A and B values range from -127 to 128, #so we divide the values by 128 to restrict values to between -1 and 1. X

当我尝试对5000张图像执行rgb到实验室操作时,如下所示:

import cv2
X =[]
Y =[]
for img in img_arr:
    X.append(img[:,:,0]) 
    Y.append(img[:,:,1:] / 128) #A and B values range from -127 to 128, 
    #so we divide the values by 128 to restrict values to between -1 and 1.
X = np.array(X)
Y = np.array(Y)
X = X.reshape(X.shape+(1,)) #dimensions to be the same for X and Y
print(X.shape)
print(Y.shape)
我的可乐坏了。
我正在尝试制作一个神经网络,它以输入作为图像的l通道,以a*b作为输出来比较误差,但我无法得到5000幅图像的阵列。是否有替代方案。

由于完全利用了RAM,它很可能会崩溃。在colab中运行上述代码时,您是否检查了资源?是的,colab因完全利用RAM而崩溃,但我不知道如何更改我的代码,很可能是因为完全利用RAM而崩溃。在colab中运行上述代码时,您是否检查了资源?是的,colab由于完全使用RAM而崩溃,但我不知道如何更改代码