zcemycl / TF2DeepFloorplan

TF2 Deep FloorPlan Recognition using a Multi-task Network with Room-boundary-Guided Attention. Enable tensorboard, quantization, flask, tflite, docker, github actions and google colab.
GNU General Public License v3.0
191 stars 62 forks source link

train model error #84

Closed 3477026455 closed 3 months ago

3477026455 commented 3 months ago

use command "python -m src.dfp.train --batchsize=4 --lr=5e-4 --epochs=3000 --logdir=log/store --modeldir=model/store" to train a model,when I use the command "python -m src.dfp.deploy --image resources/123.jpg --weight log/store/G --postprocess --colorize --save output.jpg --loadmethod log", the output image only display the segmentation of wall 、window and door.why is that ?

3477026455 commented 3 months ago

output output image like this

zcemycl commented 3 months ago

@3477026455 it is a gradient collapse due to overfitting. I usually only train on less than 500 epochs, or slower learning rate, unless you have many training data. (An observation i had few years ago, if the room-boundary attention is learnt too quickly, the room type detection which depends on it can lead to gradient collapse showing all black)