I want to understand how to generate a low resolution image for a high resolution using convolutional neural networks.
Is it necessary to have a smaller input image on the network and the output is an image twice the size?
I made the following model:
w,h,c=x_train[0].shape
input = Input(shape=(w,h,c),name='LR')
x = UpSampling2D(size=(2,2), name='UP')(input)
h = Dense(720, activation='relu', name ='hide')(x)
h2= Dense(1280, activation='relu', name ='hide2')(h)
output= Dense(3, activation='relu', name ='output')(h2)
model = Model(inputs=input, outputs=output)
model.compile(loss='mse', optimizer='adam', metrics=['accuracy'])
model.fit(x_train,y_train, epochs=50, verbose=0)
Y_train is twice the size of x_train.
But I get the following error message :
ResourceExhaustedError: OOM when allocating tensor with shape[4608000,720] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cpu
[[{{node hide/MatMul}}]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info
What am I doing wrong?