Open Speido opened 4 years ago
Most likely you didn't install the module properly. Have you run python setup.py install
in the corresponding conda environment?
I met the same error.
_AttributeError: module 'diffvg' has no attribute 'FilterType'_
I git clone the code, and pip install all requirements. Then I run python setup.py install .
Using c:\programdata\anaconda3\envs\torch\lib\site-packages Finished processing dependencies for diffvg==0.0.1
But when run single_circle.py, it showed ModuleNotFoundError: No module named 'diffvg'. So I copied all diffvg project in my conda environment site_packages. when import pydiffvg, the error occured:
File "single_circle.py", line 2, in
Same problem on my windows install
Renaming the site-packages/diffvg-0.0.1-py3.8-win-amd64.egg/diffvg file to diffvg.pyd seems to have fixed this for me.
Renaming the site-packages/diffvg-0.0.1-py3.8-win-amd64.egg/diffvg file to diffvg.pyd seems to have fixed this for me.
Hi, thank you! This helped me to solve the problem "ModuleNotFoundError: No module named 'diffvg'" in "pydiffvg\render_pytorch.py" file. I use win10 with pip.
Renaming the site-packages/diffvg-0.0.1-py3.8-win-amd64.egg/diffvg file to diffvg.pyd seems to have fixed this for me.
Thanks a lot! I used conda + win10, encountered the same issue as @IzhanVarsky did, and resolved it thanks to your help.
The library compiles without errors under Windows (Windows 10, Python 3.8, torch 1.6, VS2019). However, running examples results in:
python single_circle.py Traceback (most recent call last): File "single_circle.py", line 1, in <module> import pydiffvg File "C:\conda\envs\NR\lib\site-packages\diffvg-0.0.1-py3.8-win-amd64.egg\pydiffvg\__init__.py", line 4, in <module> from .render_pytorch import * File "C:\conda\envs\NR\lib\site-packages\diffvg-0.0.1-py3.8-win-amd64.egg\pydiffvg\render_pytorch.py", line 18, in <module> class RenderFunction(torch.autograd.Function): File "C:\conda\envs\NR\lib\site-packages\diffvg-0.0.1-py3.8-win-amd64.egg\pydiffvg\render_pytorch.py", line 27, in RenderFunction filter = pydiffvg.PixelFilter(type = diffvg.FilterType.box, AttributeError: module 'diffvg' has no attribute 'FilterType'
dir(diffvg) ['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
Any advice?