Git Product home page Git Product logo

deep-image-analogy-pytorch's People

Contributors

ben-louis 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

deep-image-analogy-pytorch's Issues

/libmkl_core.so: invalid ELF header

I cannot run it at all! I tried different versions of py-torch and cuda, but I keep getting ELF header error. My OS is latest Ubuntu (just in case).

ImportError: /data/miniconda3/envs/analogy4/lib/python3.6/site-packages/torch/lib/../../../../libmkl_core.so: invalid ELF header

Double check with run-time

Hi, thanks for this great pytorch implementation. I run the code for the demo image pair on GPU and it takes about 40min. The result is good. Just double check, is my run-time close to yours?

Expected object of type torch.DoubleTensor but found type torch.cuda.DoubleTensor for argument #2 'other

sudo python3 main.py
libpng warning: iCCP: known incorrect sRGB profile
patch_size:3; iters:10; rand_d:32
Done All Iterations
patch_size:3; iters:10; rand_d:32
Done All Iterations
12 20 29
Traceback (most recent call last):
  File "main.py", line 49, in <module>
    img_AP, img_B = analogy(img_A, img_BP, config)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/DeepAnalogy.py", line 85, in analogy
    iters=400, display=False)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/VGG19.py", line 142, in get_deconvoluted_feat
    noise, stat = lbfgs(f, noise, maxIter=iters, gEps=1e-4, histSize=4, lr=lr, display=display)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/lbfgs.py", line 60, in lbfgs
    step, stat_ls, args = linesearch(xk.clone(), z, f, fk, gk.clone(), fkm1,gkm1.clone(), 10000, lr)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/lbfgs.py", line 131, in linesearch
    strong_wolfe = torch.DoubleTensor(np.abs(phi_prime_alpha) <= -c2 * phi_prime_0)
RuntimeError: Expected object of type torch.DoubleTensor but found type torch.cuda.DoubleTensor for argument #2 'other'

@Ben-Louis Can you help me in this?

Vgg19.py giving me this error

/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/VGG19.py:137: UserWarning: invalid index of a 0-dim tensor. This will be an error in PyTorch 0.5. Use tensor.item() to convert a 0-dim tensor to a Python number
  return loss.data[0], grad
Traceback (most recent call last):
  File "main.py", line 49, in <module>
    img_AP, img_B = analogy(img_A, img_BP, config)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/DeepAnalogy.py", line 85, in analogy
    iters=400, display=False)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/VGG19.py", line 142, in get_deconvoluted_feat
    noise, stat = lbfgs(f, noise, maxIter=iters, gEps=1e-4, histSize=4, lr=lr, display=display)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/lbfgs.py", line 60, in lbfgs
    step, stat_ls, args = linesearch(xk.clone(), z, f, fk, gk.clone(), fkm1,gkm1.clone(), 10000, lr)
  File "/home/kadia/Documents/Deep-Image-Analogy-PyTorch-master/lbfgs.py", line 131, in linesearch
    strong_wolfe = (np.abs(phi_prime_alpha) <= -c2 * phi_prime_0)
RuntimeError: Expected object of type torch.DoubleTensor but found type torch.cuda.DoubleTensor for argument #2 'other'

Runtime can be reduced

I use numba instead of parallel computing. The PatchMatch process runtime can be reduced. Python is not good for 'for' loops and numba can solve this. The main time cost is in the LBFGS process.

Adam vs lbfgs

Hey, just got this running. My test case is:

image

to:

image

Using weight 2. Testing with weight 3 now. A couple questions for you as I'm relatively new to ML.

I notice that Harvey Slash made some modifications, moving to adam optimizer for example. Is there a reason you stuck with lbfgs? Would it be worth attempting a few of his changes?

This is very fun, thanks for releasing it. Any tips are much appreciated.

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.