BachiLi / diffvg

Differentiable Vector Graphics Rasterization
https://people.csail.mit.edu/tzumao/diffvg/
Apache License 2.0
933 stars 156 forks source link

A few problems to notice when installing #60

Open iscas-zac opened 1 year ago

iscas-zac commented 1 year ago

Recently I decided to play with Word-As-Image, which depends on diffvg project. I pulled the repo and tried to follow the python setup.py install instruction, but encounters a few problems. I list them below, for developers to consult with.

  1. NoneType error as in https://github.com/BachiLi/diffvg/issues/57. This error comes from the undefined LIBDIR config variable. I'm using a Miniconda3 / python 3.8 environment, and not sure if the absence of it is abnormal, but I found another variable called LIBDEST, and replaced the former one.
  2. cmake fail with

    subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1.

I located the error in subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp) in setup.py, but first assumed that this is caused by not using CUDA. I rewrote some lines in setup.py, in vain. Then I assumed some cmake config error and looked at the cmake prompts, no use. The final solution lies in the error message

(path\to)\diffvg\diffvg.h(97,15): error C2169: 'log2': intrinsic function, cannot be defined [(path\to)\diffvg\build\temp.win-amd64-cpython-38\Release\diffvg.vcxproj]

and I commented out the inline double log2(double x) { .. } function in diffvg.h. It works.

  1. diffvg import error. I found some reference to it here, and solved it with https://github.com/BachiLi/diffvg/issues/12#issuecomment-917303306 .
udiland commented 1 year ago

I also get the camke fail but couldnt solve it with the commenting out solution. (on linux)

iscas-zac commented 1 year ago

I'll make a few remarks about my situation. I'm on Win11, with a poor AMD RX 640 graphics card, used Scoop to install Miniconda3, and noticed red error lines when processing the subprocess.check_call.

iscas-zac commented 1 year ago

In your situation, I will first check if this problem arises from cmake --build ., and then go through the outputs for some red lines.

udiland commented 1 year ago

Thanks! I have little experience doing this, but also like to plat with Words-As-Image..

iscas-zac commented 1 year ago

Actually I also have little experience with neural networks. I'm now puzzled with training issues now. haha

udiland commented 1 year ago

I meant with installing, configuring and such... :) Good luck.

hankunbo commented 1 year ago

I also get the camke fail but couldnt solve it with the commenting out solution. (on linux)

same question

udiland commented 1 year ago

I also get the camke fail but couldnt solve it with the commenting out solution. (on linux)

same question

You can try Install/update 'build-essential'

kepurG commented 2 months ago

I spent days and nights to complete the diffvg compilation on Windows. If anyone wants the wheels, you can contact me +V13862010554. Let's create a group to communicate and exchange about the improvements based on the module together.