DifferentiableSketching icon indicating copy to clipboard operation
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:

Open quantacode opened this issue 3 years ago • 3 comments

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

quantacode avatar Dec 28 '21 03:12 quantacode

Hi,

I wanted to play with the image optimization code but getting a similar error:

Screen Shot 2021-12-27 at 10 16 48 PM

Can you please help?

quantacode avatar Dec 28 '21 03:12 quantacode

Hi,

I wanted to play with the image optimization code but getting a similar error:

Screen Shot 2021-12-27 at 10 16 48 PM

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

Chauban avatar Dec 30 '21 05:12 Chauban

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.

jonhare avatar Dec 30 '21 22:12 jonhare