diffvg
diffvg copied to clipboard
module 'diffvg' has no attribute 'FilterType_'
!!!I met the same error @BachiLi ,and I really need your help.
AttributeError: module 'diffvg' has no attribute 'FilterType'
I git clone the code, and pip install all requirements. Then I run python setup.py install successful.
Using c:\programdata\anaconda3\envs\torch\lib\site-packages Finished processing dependencies for diffvg==0.0.1
But when I 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
My environment: windows10 Anaconda3 python3.7
It's possible you have a diffvg
directory present in the scope that you're running your program, so it's looking there for the attribute and not finding it. After installing, try renaming diffvg
to temp_diffvg
or something else; that cleared up this problem for me. (Running in a Colab notebook, not Windows.)
this didn't work for me. the only environment that works is python 3.6 for some reason. Every other fresh build of python yields extern errors for Cuda on the build. this builds but can't find diffvg.
It's the FilterType
here, it doesn't exist on which ever version it's importing.
filter = pydiffvg.PixelFilter(type = diffvg.FilterType.box,
radius = torch.tensor(0.5)),
same error
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.
I faced the same problems and made some changes until it worked on the Google Colab.
-
Down grade Tensorflow to version 1.X.
%tensorflow_version 1.x
import tensorflow as tf
print(tf.__version__)
-
Add "pydiffvg" path to c compiled file?
import sys
sys.path.append("/content/CLIPasso/diffvg/build/lib.linux-x86_64-3.7")
-
Upgrade Pillow.
!pip3 install --upgrade Pillow
If you are working on Google Colab, try restarting the runtime after installing diffvg, that worked 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.
I have no idea why but this solved it 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.
Thanks @d00ML0rDz, It work for me.