Giter Club home page Giter Club logo

Comments (14)

JPW0080 avatar JPW0080 commented on June 12, 2024 2

In order to solve the issue some users have suggested using WSL on Windows to set up a Unix-based environment.
@yvrjsharma yeah that's what I did, worked for me

On Windows, simply copy/paste \PhotoMaker\gradio_demo folder contents to \PhotoMaker

Now it should be possible to run python app.py as normal.

from photomaker.

bmaltais avatar bmaltais commented on June 12, 2024 2

@anderslogg @wandrzej I recreated a PhotoMaker environment and pulled PhotoMaker again. The result is displayed as follows.
微信截图_20240116013611

The library is linux only, this won't work on windows

also can you add the following to the requirements.txt file

diffusers spaces transformers accelerate

I have modified the windows installation instructions an re-arranged some of the files in the repo to make it work easilly on Windows: https://github.com/bmaltais/PhotoMaker

from photomaker.

anderslogg avatar anderslogg commented on June 12, 2024 1

It seems there's no proper Python setup (setup.py or pyproject.toml). Try doing this in the top-level directory:

export PYTHONPATH=`pwd`:$PYTHONPATH

That took care of the above problem for me. Still no success running it :-( The demo gradio_demo/app.py just hangs. I get the web page served and can upload a photo but then nothing happens.

from photomaker.

egokick avatar egokick commented on June 12, 2024 1

@anderslogg @wandrzej I recreated a PhotoMaker environment and pulled PhotoMaker again. The result is displayed as follows.

微信截图_20240116013611

The library is linux only, this won't work on windows

also can you add the following to the requirements.txt file

diffusers
spaces
transformers
accelerate

from photomaker.

egokick avatar egokick commented on June 12, 2024 1

In order to solve the issue some users have suggested using WSL on Windows to set up a Unix-based environment.
@yvrjsharma yeah that's what I did, worked for me

from photomaker.

Datou avatar Datou commented on June 12, 2024 1

Hi. I am able to run the gradio_demo/app.py file by following the suggested steps from the project readme. I am currently running this on a Colab-pro using the provided CLI, as I do not have access to a local GPU at the moment. Initially, I was also encountering the error you reported in your post on the top. However, it was resolved for me after adding the following code lines on top of the app.py script:

# Add at the very top of app.py
import sys
sys.path.append('/content/PhotoMaker')

This helps the script to set up its own search path correctly when it runs as a script (in the Colab env.) This modification actually helps the runtime environment of the script to include the directory where photomaker is located and thus it is able to locate the file photomaker/pipeline.
My best guess is that this is a Windows environment-related error that you are encountering over here. The error shown in the screenshot is ValueError: cannot find context for 'fork', which is typically related to the multiprocessing features in Python, as per this issue on the transformers repo.
In order to solve the issue some users have suggested using WSL on Windows to set up a Unix-based environment. Alternatively, one can replace fork with spawn as the start method for multiprocessing on Windows. However, I am not entirely sure how to do this myself.
Hope this information is helpful to you.

Thank you for providing me with inspiration. The problem arises from the incorrect module name. Change from photomaker.pipeline in app.py to from pipeline Change from photomaker.model in pipeline.py to from model Can continue, but another error occurs 微信截图_20240116111233

I have also encountered the same problem. I hope you can find a solution.

from photomaker.

Paper99 avatar Paper99 commented on June 12, 2024 1

Hello everyone, first of all, thank you for your discussions, which helped us fix many known issues in environment construction (in the latest version).

Now, you could update the environment building through:

conda create --name photomaker python=3.10
pip install -U pip

# Install requirements
pip install -r requirements.txt

# Install photomaker
pip install git+https://github.com/TencentARC/PhotoMaker.git

Then you can run the following command to use our PhotoMaker:

from photomaker import PhotoMakerStableDiffusionXLPipeline

The previous line can also be used outside the repo.

from photomaker.

wandrzej avatar wandrzej commented on June 12, 2024

It seems there's no proper Python setup (setup.py or pyproject.toml). Try doing this in the top-level directory:

export PYTHONPATH=`pwd`:$PYTHONPATH

That took care of the above problem for me. Still no success running it :-( The demo gradio_demo/app.py just hangs. I get the web page served and can upload a photo but then nothing happens.

would probably help to add in the last line, in demo.launch() debug=True parameter and checking what's going on.

from photomaker.

Crazy-CYZ avatar Crazy-CYZ commented on June 12, 2024

@anderslogg @wandrzej
I recreated a PhotoMaker environment and pulled PhotoMaker again. The result is displayed as follows.

微信截图_20240116013611

from photomaker.

yvrjsharma avatar yvrjsharma commented on June 12, 2024

Hi. I am able to run the gradio_demo/app.py file by following the suggested steps from the project readme. I am currently running this on a Colab-pro using the provided CLI, as I do not have access to a local GPU at the moment. Initially, I was also encountering the error you reported in your post on the top. However, it was resolved for me after adding the following code lines on top of the app.py script:

# Add at the very top of app.py
import sys
sys.path.append('/content/PhotoMaker')

This helps the script to set up its own search path correctly when it runs as a script (in the Colab env.)
This modification actually helps the runtime environment of the script to include the directory where photomaker is located and thus it is able to locate the file photomaker/pipeline.

My best guess is that this is a Windows environment-related error that you are encountering over here. The error shown in the screenshot is ValueError: cannot find context for 'fork', which is typically related to the multiprocessing features in Python, as per this issue on the transformers repo.

In order to solve the issue some users have suggested using WSL on Windows to set up a Unix-based environment. Alternatively, one can replace fork with spawn as the start method for multiprocessing on Windows. However, I am not entirely sure how to do this myself.

Hope this information is helpful to you.

from photomaker.

Crazy-CYZ avatar Crazy-CYZ commented on June 12, 2024

Hi. I am able to run the gradio_demo/app.py file by following the suggested steps from the project readme. I am currently running this on a Colab-pro using the provided CLI, as I do not have access to a local GPU at the moment. Initially, I was also encountering the error you reported in your post on the top. However, it was resolved for me after adding the following code lines on top of the app.py script:

# Add at the very top of app.py
import sys
sys.path.append('/content/PhotoMaker')

This helps the script to set up its own search path correctly when it runs as a script (in the Colab env.) This modification actually helps the runtime environment of the script to include the directory where photomaker is located and thus it is able to locate the file photomaker/pipeline.

My best guess is that this is a Windows environment-related error that you are encountering over here. The error shown in the screenshot is ValueError: cannot find context for 'fork', which is typically related to the multiprocessing features in Python, as per this issue on the transformers repo.

In order to solve the issue some users have suggested using WSL on Windows to set up a Unix-based environment. Alternatively, one can replace fork with spawn as the start method for multiprocessing on Windows. However, I am not entirely sure how to do this myself.

Hope this information is helpful to you.

Thank you for providing me with inspiration. The problem arises from the incorrect module name.
Change from photomaker.pipeline in app.py to from pipeline
Change from photomaker.model in pipeline.py to from model
Can continue, but another error occurs
微信截图_20240116111233

from photomaker.

EdwardOwusuAdjei avatar EdwardOwusuAdjei commented on June 12, 2024

On Windows, simply copy/paste \PhotoMaker\gradio_demo folder contents to \PhotoMaker

Now it should be possible to run python app.py as normal.

Same for mac or anyone facing same. Simplest fix

from photomaker.

yvrjsharma avatar yvrjsharma commented on June 12, 2024

Can try simply importing the typing module and see how it goes? @Crazy-CYZ

import typing 

Can continue, but another error occurs

from photomaker.

JaosonMa avatar JaosonMa commented on June 12, 2024

what i do is that
1、copy gradio_demo/* to photomaker/*
2、change "from photomaker.xxxx import xxx" to "from xxxx imoprt xxxx"
the ok

from photomaker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.