lizhengwei1992 / Semantic_Human_Matting

Semantic Human Matting
527 stars 145 forks source link

little problem #11

Open wuzb19951013 opened 5 years ago

wuzb19951013 commented 5 years ago

I'm sorry when I ran your code it always shows local variable 'i' referenced before assignment when it runs to File "train.py", line 247, in main loss = loss / (i+1)

so do you know what's wrong about this place? Thank you~

wuzb19951013 commented 5 years ago

Is it the lack of space?

pourfard commented 5 years ago

'i' is declared in line 219 and it is not an error in my case. By the way you can replace 'i' in line 247 with count_of_total_train_items/your_batch_size because at the end of for loop 'i' will be the number of batches minus one.

wuzb19951013 commented 5 years ago

Oh,I see, thank you very much And Is the end result of this program to get a mask of the video?

pourfard commented 5 years ago

I have trained this repo for several days with about 20k generated image but the results are not satisfactory. But if it works for one image, you can use it for video too.

wuzb19951013 commented 5 years ago

Did the trimap for training need to be 3 channels? And the sequence is fg, bg. unsure? When I pretrain the T-net,the groundtruth of the Trimap is [4,1,320,320], but the prediction of the Trimap is [4,3,320,320]. So is the input illegal? or are there something wrong in other places?

pourfard commented 5 years ago

Yes, that's OK, 3 is the number of classes. The source code does not have bugs. But the results are poor. I've trained MMNET and got better results.

wuzb19951013 commented 5 years ago

You are right. the results are not so good. And I'm not sure whether the L_composition without bg works or not and has any effect on the results. but it still is a good work