In tensorflow, after I set the trainable flag of each layer to False, attempting to train the network does not change the weights (as expected). However, each epoch still takes the same amount of time (about 12 seconds) to train, just like training without freezing any layers would.
For clarification, I set the trainable flag of each layer to False before compilation.
for i in range(len(model.layers)):
model.layers[i].trainable = False
Does anyone know why this is happening? My actual intention is to reduce training time of the network by freezing some weights. When freezing some weights did not reduce the training time, I tried to freeze all weights, but even that did not lead to a reduction in training time.
It may be worth mentioning that I am using tensorflow 1.12.0