Python 在为图像着色准备数据时,colab中的会话崩溃
当我尝试对5000张图像执行rgb到实验室操作时,如下所示: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
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而崩溃,但我不知道如何更改代码