Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> Its possible that you've got multiple python versions and installed the package using python 2 rather than 3. Try reinstalling with: #4

Open
quantacode opened this issue Dec 28, 2021 · 3 comments

Comments

@quantacode
Copy link

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 #1 (comment)

@quantacode
Copy link
Author

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?

@Chauban
Copy link

Chauban commented Dec 30, 2021

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

@jonhare
Copy link
Owner

jonhare commented Dec 30, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants