ben-louis / deep-image-analogy-pytorch Goto Github PK
View Code? Open in Web Editor NEWA python implementation of Deep-Image-Analogy based on pytorch.
License: MIT License
A python implementation of Deep-Image-Analogy based on pytorch.
License: MIT License
Unable to access the model url in VGG19.py. "https://s3-us-west-2.amazonaws.com/jcjohns-models/vgg19-d01eb7cb.pth" seems to be forbidden can you please check or suggest alternate.
Hey, just got this running. My test case is:
to:
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.
是否支持高清大图?
Hi,
I maintain my own version https://github.com/Ben-Louis/Deep-Image-Analogy-PyTorch of this paper, but I was unable to get results close to the paper.
However, your results match almost perfectly.
Could you tell me if there is anything different that I am doing, or I should try out ?
This is a good job, but it costs much time to run one example. Do u solve the problem about runtime ?
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?
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.
/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'
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.