DifferentiableSketching
DifferentiableSketching copied to clipboard
> Its possible that you've got multiple python versions and installed the package using python 2 rather than 3. Try reinstalling with:
Its possible that you've got multiple python versions and installed the package using python 2 rather than 3. Try reinstalling with:
pip3 -r requirements.txt python3 setup.py install
It cannot run yet. However, I move the file "imageopt.py" into the ../../..,just in the DifferentiableSketching. It can run but another error occured. It looks strange.
/usr/local/lib/python3.7/dist-packages/torch/functional.py:445: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:2157.) return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined] Setting up [LPIPS] perceptual loss: trunk [vgg], v[0.1], spatial [off] Loading model from: /usr/local/lib/python3.7/dist-packages/lpips/weights/v0.1/vgg.pth 0% 1/500 [01:33<12:53:59, 93.06s/it, loss=0.725, sigma^2=0.000264]^C
Originally posted by @BingoGreen in https://github.com/jonhare/DifferentiableSketching/issues/1#issuecomment-997772614
Hi,
I wanted to play with the image optimization code but getting a similar error:

Can you please help?
Hi,
I wanted to play with the image optimization code but getting a similar error:
Can you please help?
You can find the imageopt.py in .\dsketch\experiments\imageopt
Just move this .py file into .\
Then run the example command as python imageopt.py --loss LPIPSLoss --net vgg --invert --seed 1234 --width 300 --lines 2000 --init-sigma2 1.0 --final-sigma2 1.0 --iters 500 --lr 0.01 --init-raster results/vancouver/init.png --final-raster results/vancouver/final.png --init-pdf results/vancouver/init.pdf --final-pdf results/vancouver/final.pdf --snapshots-path results/vancouver data/vancouver.jpg --snapshots-steps 100 --colour
Okay, my bad... I didn't realise that setuptools behaves rather differently in development mode & would mask missing bits from setup.py. Try pulling the latest code now and re-running python setup.py install. Hopefully everything will work then.