GoGoDuck912 / Self-Correction-Human-Parsing

An out-of-box human parsing representation extractor.
MIT License
1.05k stars 236 forks source link

Cannot reproduce the results from the paper - Problem with InPlaceABNSync? #88

Open alexandrewillame opened 9 months ago

alexandrewillame commented 9 months ago

I cannot reproduce the results from the paper. I suspect it is a problem with the InPlaceABNSync function.

The code as-is does not work on my computer (either on Windows 11 or WSL = Linux), some problem with Ninja / C++ compiling. I want to get rid of the code that uses Ninja which is the code of the InPlaceABNSync function.

I thus modified the AugmentCE2P to bypass InPlaceABNSync which is the module that uses Ninja/cpp functions.. I modified networks/AugmentCE2P.py, line 21 and 23:

from modules import InPlaceABNSync

BatchNorm2d = functools.partial(InPlaceABNSync, activation='none')

I deleted these lines and replaced them by the following:

from torch.nn import BatchNorm2d
def InPlaceABNSync(input):
    return BatchNorm2d(input)

Thus supposedly using the standard torch BatchNorm2d instead of the InPlaceABNSync version, assuming InPlaceABNSync is just a BatchNorm2d function with no activation layer.

The code run without error, but if we take the demo example (demo/demo.jpg) using the lip dataset using the latest checkpoint (exp-schp-201908261155-lip.pth)t, it is far from what is expected:

image

Instead of:

image

The source image is indeed exactly the same, there is thus a difference somewhere in the code.

Can somebody help / show how to make the code work properly without the use of InPlaceABNSync?

Thank you,

madanmanit commented 2 months ago

Did you find a solution? I too am using a windows 11 env