Morphogens / ProsePainter

GNU General Public License v3.0
281 stars 33 forks source link

server-env.yml #2

Closed kendrick90 closed 2 years ago

kendrick90 commented 2 years ago

In the readme it's listed as .yaml but is .yml and when I tried to run it I ran into this issue https://github.com/conda/conda/issues/10807 where pip was expecting user input but conda never showed it so it got stuck. I went to manually install the pip packages and found that the error is when pip installs geniverse. versioneer was not installed first. So I went to install that but then when installing geniverse again it shows versioneer has no module get-version. This all happens when looking at the opt_einsum and mypy package. Any help?

vipermu commented 2 years ago

Hey! Thanks for spotting that typo. I was not able to reproduce the problem you mention with conda. Do you know which user prompt is pip asking for? Though, I got into some problems due to a lack of permissions in the folder where the packages where tried to be installed in a Google Cloud VM (which I ended up solving them by re-installing conda, creating a new conda env and installing the libraries in there). Are you installing the pip packages from a venv? And which version of python and conda/miniconda are you using? Could you try running pip with the --upgrade option?

Elevory commented 2 years ago

I'm not OP, but I'm also having an issue with the Python server install command. I tried the --upgrade option, and even specified Python v3.7 for the Conda environment (it defaulted to v3.8 the first time around) - no dice.

It seems to hang here:

Installing pip dependencies: ...working...

I also attempted to install the pip packages manually and, like OP mentioned, the issue seems to arise during the geniverse routine. In my case, it froze while trying to install Beaker.

I'm doing this locally on a Windows 11 machine, by the way. Conda v4.10.3.

kendrick90 commented 2 years ago

I'm actually thinking pip isn't looking for user input but is getting stuck trying to resolve dependencies. It's happening when trying to install geniverse. Yes I was installing trying to install the packages into the same prosepainter venv after it hung. I saw some other errors relating to 2to3 as well. It's probably a pip/setuptools version problem and/or geniverse not being restrictive enough to resolve the dependencies. I just left it running for like 5 hours and the wheel was still spinning. I will post my full log of trying to install geniverse inside the venv created by the yml file. Starting install now.

I'm on 64 Bit Windows 11 Conda 4.10.3 Python 3.7.9 Pip 21.0.1

kendrick90 commented 2 years ago

geniverse.log Okay this is enough for now. Will try downgrading pip and trying again.

kendrick90 commented 2 years ago

Looks like pycryptodomex is failing due to lack of ms visual studio C++ build tools. Installing now File "c:\users\kendrick\anaconda3\envs\prosepainter\lib\site-packages\setuptools\msvc.py", line 271, in _msvc14_get_vc_env "Unable to find vcvarsall.bat" distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ Testing support for clang

kendrick90 commented 2 years ago

Now also seeing an error for Collecting jaxlib>=0.1.37 (from optax->flax>=0.3.4->geniverse) Could not find a version that satisfies the requirement jaxlib>=0.1.37 (from optax->flax>=0.3.4->geniverse) (from versions: ) No matching distribution found for jaxlib>=0.1.37 (from optax->flax>=0.3.4->geniverse)

kendrick90 commented 2 years ago

SOL looks like Jaxlib is not supported on windows https://github.com/cloudhan/jax-windows-builder close as it get's but no cuda 11.0 support so I guess I give up.

vipermu commented 2 years ago

Hmm got it, I only tested this stuff on linux. Just disabled the automatic installation of jax and jaxlib, hope this solves the issues with those packages. They are not necessary for using VQGAN so it should be fine. Lmk if it works now :) Install the latest version of the library using the --upgrade option.

Elevory commented 2 years ago

Hmm got it, I only tested this stuff on linux. Just disabled the automatic installation of jax and jaxlib, hope this solves the issues with those packages. They are not necessary for using VQGAN so it should be fine. Lmk if it works now :) Install the latest version of the library using the --upgrade option.

I'm now able to successfully install the geniverse library, but server_deploy.py encounters a few issues regarding the missing packages. Granted, I've fiddled with this prosepaint environment a lot in the last 24 hours, so possibly I need to scrap it and try again from scratch. Either way, here are the errors I'm running into:

  File "C:\Users\Elevory\anaconda3\envs\prosepaint\lib\site-packages\geniverse\modeling_utils.py", line 11, in <module>
    import matplotlib.pyplot as plt
ModuleNotFoundError: No module named 'matplotlib'

Resolved with pip install matplotlib.

  File "C:\Users\Elevory\anaconda3\envs\prosepaint\lib\site-packages\geniverse\models\dalle_mini\modeling_dalle_mini.py", line 8, in <module>
    import jax
ModuleNotFoundError: No module named 'jax'
  File "C:\Users\Elevory\anaconda3\envs\prosepaint\lib\site-packages\forks\dalle_mini\dalle_mini\model.py", line 2, in <module>
    import jax
ModuleNotFoundError: No module named 'jax'

If I remove the jax imports, I get another error about a similarly-named package:

  File "C:\Users\Elevory\anaconda3\envs\prosepaint\lib\site-packages\forks\dalle_mini\dalle_mini\model.py", line 2, in <module>
    import flax.linen as nn
ModuleNotFoundError: No module named 'flax'

On top of that, flax seems to require jax, so I cannot install it via pip.

Any ideas?

Thank you!

kendrick90 commented 2 years ago

I was able to get past the initial issues now on a fresh venv. Then had to use set instead of export for windows. Then had to install nodejs in conda to use npm. Now I have the app loaded at http://localhost:8003/ but the socket is not connected. I'm guessing this means I didn't set/export the python server correctly or something. Will fiddle a bit more.

Elevory commented 2 years ago

I was able to get past the initial issues now on a fresh venv. Then had to use set instead of export for windows.

Yep, I forgot to mention that I had to use set instead of export as well.

Try executing the python command separately instead of all in one line. Let me know if you run into the same errors I got...

EDIT: As far as the set command goes, mine looks like this:

set PYTHONPATH=%PYTHONPATH%;C:\my\prosepainter\location

I don't know if this is ideal or correct, but either way, I don't believe it's related to the errors I mentioned above.

kendrick90 commented 2 years ago

I separated them out too. And yeah I just got to the part where after installing matlib plot and jax it complains about needing jaxlib again. Looks like dalle mini depends on jax which depends on jaxlib but which isn't supported on windows. There's a workardound here but it doesn't support the version of cuda that we're using https://github.com/cloudhan/jax-windows-builder

vipermu commented 2 years ago

@kendrick90 @Elevory Hey guys, update to version 0.0.7 of geniverse, you should be able to run it now without the matplotlib dependency issue and without the dalle-mini problem (jax, jaxlib and flax). Thanks for spotting these bugs! Lmk if there are any further problems, so far I've only tested the code with Linux.

kendrick90 commented 2 years ago

Thanks got it working! The caveats being I added geniverse==0.0.7 and nodejs to the sever-env file and use set PYTHONPATH=. && python server/server_deploy.py image

Elevory commented 2 years ago

Yep, it's working on my end too! Just one thing to note: there was another package I had to install before the server would cooperate:

WARNING: No supported WebSocket library detected. Please use 'pip install uvicorn[standard]', or install 'websockets' or 'weproto' manually.

The first suggested command did the trick.

I also had to lower the min and max image resolution in server_config.py for my puny 4GB of VRAM, but that's another matter. :)