bobqywei / inpainting-partial-conv

PyTorch implementation of "Image Inpainting for Irregular Holes Using Partial Convolutions"
77 stars 26 forks source link

mask update #11

Open laulampaul opened 5 years ago

laulampaul commented 5 years ago

could i ask a question about how to update the mask?cause i dont understand the code clearly. in the mask,1 means need to process and 0 means dont , in the new mask ,the number of 1 becomes larger or smaller? thank you ~

erhuodaosi commented 5 years ago

@laulampaul As for the mask,masks have the same shape as the original picture(3256256),gt * mask becomes comp.It means when the value of mask is 1,the comp use the gt content, in reverse,we replace the corresponding comp with white area.When it talks to the mask update,if the current mask area have at least one value,after a partial convolution,the current mask area would be all 1.therefor,after some partial convolutions.the mask will be all 1 eventually.

erhuodaosi commented 5 years ago

@laulampaul I have a question,have you met such question while training the model: (py3) [fl@ibcu05 place2]$ python train.py Loaded training dataset with 1434892 samples and 55116 masks Loaded model to device... Setup Adam optimizer... Setup loss function...

EPOCH:0 of 3 - starting training loop from iteration:0 to iteration:89680

0%| | 0/89680 [00:00<?, ?it/s] Traceback (most recent call last): File "train.py", line 141, in loss_dict = loss_func(image, mask, output, gt) File "/home/fl/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/home/fl/place2/loss.py", line 94, in forward loss_dict["tv"] = total_variation_loss(composed_output, self.l1) LAMBDAS["tv"] File "/home/fl/place2/loss.py", line 50, in total_variation_loss loss = l1(image[:, :, :, :-1] - image[:, :, :, 1:]) + l1(image[:, :, :-1, :] - image[:, :, 1:, :]) File "/home/fl/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) TypeError: forward() missing 1 required positional argument: 'target'

laulampaul commented 5 years ago

@erhuodaosi i dont meet such question cause i only use code of the partial conv. but the bug mean that l1 should have 2 argument

erhuodaosi commented 5 years ago

@laulampaul Thank you

gonghuiyun commented 5 years ago

@laulampaul I have a question,have you met such question while training the model: (py3) [fl@ibcu05 place2]$ python train.py Loaded training dataset with 1434892 samples and 55116 masks Loaded model to device... Setup Adam optimizer... Setup loss function...

EPOCH:0 of 3 - starting training loop from iteration:0 to iteration:89680

0%| | 0/89680 [00:00<?, ?it/s] Traceback (most recent call last): File "train.py", line 141, in loss_dict = loss_func(image, mask, output, gt) File "/home/fl/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, kwargs) File "/home/fl/place2/loss.py", line 94, in forward loss_dict["tv"] = total_variation_loss(composed_output, self.l1) LAMBDAS["tv"] File "/home/fl/place2/loss.py", line 50, in total_variation_loss loss = l1(image[:, :, :, :-1] - image[:, :, :, 1:]) + l1(image[:, :, :-1, :] - image[:, :, 1:, :]) File "/home/fl/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(input, kwargs) TypeError: forward() missing 1 required positional argument: 'target' I have the same problem and delete “perceptual style tv” it works!