multi gpu
ValueError: You are trying to load a weight file containing 1 layers into a model with xxx layers.
we can not directly filter the name out.
we need to actually load all layers instead of just one.
with tf.device('/cpu:0'):
single_model = your_model
parallel_model = multi_gpu_model(model, gpus=n)
parallel_model.compile(loss='categorical_crossentropy',optimizer='rmsprop')
parallel_model.fit(x, y, epochs=20, batch_size=256)
single_model.summary()
single_model.save_weights(save_path)