Semantic_Human_Matting icon indicating copy to clipboard operation
Semantic_Human_Matting copied to clipboard

little problem

Open wuzb19951013 opened this issue 5 years ago • 7 comments

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 avatar Mar 23 '19 09:03 wuzb19951013

Is it the lack of space?

wuzb19951013 avatar Mar 23 '19 12:03 wuzb19951013

'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.

pourfard avatar Mar 25 '19 22:03 pourfard

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

wuzb19951013 avatar Mar 26 '19 10:03 wuzb19951013

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.

pourfard avatar Mar 26 '19 11:03 pourfard

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?

wuzb19951013 avatar Apr 02 '19 12:04 wuzb19951013

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.

pourfard avatar Apr 02 '19 14:04 pourfard

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

wuzb19951013 avatar Apr 13 '19 08:04 wuzb19951013