- use keras and tensorflow backend
- use CPU only , memory 128GB
- input data has the shape (45,1024,1024)
- the model has only one convolution , one (2,2) max pooling
- a 1024 *1024 fully connected.
I got this error message:
Invalid argument: Shape [4194304,1048576] is too large (more than 1099511627776 entries)
note that:
4194304 = 2048 * 2048
1048576 = 1024 * 1024
How did keras compute this shape? why is it too large?
The shape
[4194304, 1048576]
is computed as follows:Applying 16 convolutions of size
[3, 3]
with thesame
border mode to the inputs of size[1024, 1024, 3]
gives us output of size[1024, 1024, 16]
. After max pooling of size 2 it becomes[512, 512, 16]
which when flattened is512 * 512 * 16 = 4194304
.1048576
comes from1024 * 1024
as you specified in theDense
layer constructor.I think you should reconsider the architecture of you model. You can use inputs of smaller size, add several pooling layers, reduce dimensionality applying
1 x 1
convolutions. And I doubt that1024 * 1024
is a reasonable number of nodes in a fully connected layer.