Closed ProGamerGov closed 7 years ago
I resized all of my input images to the same height and width, and now it seems to work. I am not sure which of the images the problem was with, but maybe the mask images are not resized correctly alongside any resizing of the content/style images?
@martinbenson I solved the issue and submitted a pull request for the fix. It turns out that the masks were not resized to match their associated input images in the Lua code. Your deep_photo.py
Python script does the resizing automatically before the Lua script is used, which is why you did not come across this error that affects manual usage of the deepmatting_seg.lua
script.
I have also created a standalone version of the deepmatting_seg.lua
script without the photorealism features, for those who wish to use the regular Neural-Style with the new segmentation/Multi-Region Spatial Control features: https://gist.github.com/ProGamerGov/bcbd27a3d2e431adb73ef158d9990d93
I have been getting this error with the NIN model, and I am not sure why. My images are correctly sized, yet it still gives an error that appears to be related to the style images.
This post here indicates that NIN does work in the old version of the code: https://github.com/luanfujun/deep-photo-styletransfer/issues/29#issuecomment-290845078 I tested this and it does not seem to work.
I know that NIN works with the current version of Neural-Style as well, so there may be an issue somewhere in the mask code?
@martinbenson
This line of code is the cause of this issue:
local l_mask = l_mask_ori:repeatTensor(1,1,1):expandAs(input)
https://github.com/martinbenson/deep-photo-styletransfer/blob/master/deepmatting_seg.lua#L716
I also received this error with default VGG-19 and image_size=512 when I used a non default style_scale. It ran fine with style_scale=1.0
@martinbenson , I believe I have found an issue. When trying to run
deepmatting_seg.lua
, I get the following error:I used this command to run
deepmatting_seg.lua
:The issue appears to be related to line number 715.