Giter Site home page Giter Site logo

deep-painterly-harmonization-pytorch's People

Contributors

oldpan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

deep-painterly-harmonization-pytorch's Issues

TypeError: integer argument expected, got float

Python 2.7.15rc1
Ubuntu 18.04
Cuda 9

Running with default args

python train.py
===> Using GPU to train
===> Loaing datasets
the image ndarray size is (682, 700, 3)
===> Initialize the image...
the image tensor size is torch.Size([1, 3, 682, 700])
===> Building the painterly model...
-----Setting up style layer-----
-----Setting up style layer-----
Traceback (most recent call last):
  File "train.py", line 205, in <module>
    content_image, mask_image, tmask_image)
  File "train.py", line 145, in run_painterly_transfer
    style_weight, content_weight, tv_weight)
  File "/home/castle/Deep-Painterly-Harmonization-Pytorch/model.py", line 182, in get_model_and_losses
    (math.floor(mask_image.shape[1] / 2), math.floor(mask_image.shape[0] / 2)))
TypeError: integer argument expected, got float

Confused about the ' Independent Mapping' in this repo

Hi, @Oldpan

Firstly, im very appreciate for sharing this useful pytorch version of 'Deep-Painterly-Harmonization-Pytorch'.
However, the original paper mentioned 'Independent Mapping' in the first pass, which did not use in this repo?
I cannot run this demo for now, so, im confused that, without the 'Independent Mapping', it still can generate reasonable results in the first pass comparing with the results shown in original paper?

直方图loss 好像还有问题...

从您的blog慕名而来,想学习一下直方图loss的计算方式... 可是发现您的代码里面这一块好像还有问题...

想咨询一下直方图loss的具体实现过程,看您是准备在hook中计算loss...这是为什么呢?

Tensor size not matchable

python train.py give me

True
===> Using GPU to train
===> Loaing datasets
the image ndarray size is (682, 700, 3)
===> Initialize the image...
the image tensor size is torch.Size([1, 3, 682, 700])
===> Building the painterly model...
-----Setting up style layer-----
-----Setting up style layer-----
-----Setting up content layer-----
-----Setting up style layer-----
-----Setting up style layer-----
-----Setting up style layer-----
===> Optimizer running...
Traceback (most recent call last):
File "train.py", line 209, in
content_image, mask_image, tmask_image)
File "train.py", line 200, in run_painterly_transfer
optimizer.step(closure)
File "/home/tchaton/virtualenvs/labelbox/lib/python3.6/site-packages/torch/optim/lbfgs.py", line 103, in step
orig_loss = closure()
File "train.py", line 178, in closure
loss.backward()
File "/home/tchaton/virtualenvs/labelbox/lib/python3.6/site-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/tchaton/virtualenvs/labelbox/lib/python3.6/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
File "/home/tchaton/projects/original/Deep-Painterly-Harmonization-Pytorch/model.py", line 118, in style_hook
'grad_input:{} is not matchable with mask:{}'.format(grad_input[0].shape, self.mask.shape)
AssertionError: grad_input:torch.Size([1, 128, 170, 175]) is not matchable with mask:torch.Size([1, 1, 170, 175])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.