Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to launch Fluxgym #101

Open
chnisar515 opened this issue Sep 17, 2024 · 8 comments
Open

unable to launch Fluxgym #101

chnisar515 opened this issue Sep 17, 2024 · 8 comments

Comments

@chnisar515
Copy link

Hello Experts,
i have install fresh copy of fluxgym in my drive (E:\My AI\FluxGym\fluxgym) and i have install it successfully with all the dependencies etc with any error also download all the models, after that when i try to launch Fluxgym with this command (python app.py) with the venv activated. after this command i got this error.

(env) E:\My AI\FluxGym\fluxgym>python app.py
Traceback (most recent call last):
File "E:\My AI\FluxGym\fluxgym\app.py", line 17, in
import train_network
ModuleNotFoundError: No module named 'train_network'

@diego-treitos
Copy link
Contributor

Hi, I've just found this problem and the solution.

In app.py move the lines:

os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
os.environ['GRADIO_ANALYTICS_ENABLED'] = '0'
sys.path.insert(0, os.getcwd())
sys.path.append(os.path.join(os.path.dirname(__file__), 'sd-scripts'))

To right after import sys and import os so it looks something like this:

import os
import sys
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
os.environ['GRADIO_ANALYTICS_ENABLED'] = '0'
sys.path.insert(0, os.getcwd())
sys.path.append(os.path.join(os.path.dirname(__file__), 'sd-scripts'))
import subprocess
import gradio as gr
...

For some reason in python 3.10 app.py works but in python 3.12 it doesn't.

@chnisar515
Copy link
Author

First of all thank you so much for your reply.
i have replaced your code in app.py file, So now the file looks like below

import os
import sys
import subprocess
import gradio as gr
from PIL import Image
import torch
import uuid
import shutil
import json
import yaml
from slugify import slugify
from transformers import AutoProcessor, AutoModelForCausalLM
from gradio_logsview import LogsView, LogsViewRunner
from huggingface_hub import hf_hub_download, HfApi
from library import flux_train_utils, huggingface_util
from argparse import Namespace
import train_network
import toml
import re
import os
import sys
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1"
os.environ['GRADIO_ANALYTICS_ENABLED'] = '0'
sys.path.insert(0, os.getcwd())
sys.path.append(os.path.join(os.path.dirname(file), 'sd-scripts'))
import subprocess
import gradio as gr

but the problem still not fix.

(env) E:\fluxgym>python app.py
Traceback (most recent call last):
File "E:\fluxgym\app.py", line 17, in
import train_network
ModuleNotFoundError: No module named 'train_network'

and also my python version is

(env) E:\fluxgym>python --version
Python 3.11.9

@diego-treitos
Copy link
Contributor

I am afraid it wasn't changed the way I suggested. In any case a fix was merged in the PR #102 so just pulling the code now should fix the problem.

THank you for the python version. Then it looks like the problem appears for python > 3.10

@zq52121
Copy link

zq52121 commented Sep 21, 2024

你好专家,我的出现了这个启动错误,一直无法解决,请求帮助

I:\fluxgym>python app.py
Traceback (most recent call last):
File "I:\fluxgym\app.py", line 17, in
from gradio_logsview import LogsView, LogsViewRunner
ModuleNotFoundError: No module named 'gradio_logsview'

@fahadshery
Copy link
Contributor

你好专家,我的出现了这个启动错误,一直无法解决,请求帮助

I:\fluxgym>python app.py Traceback (most recent call last): File "I:\fluxgym\app.py", line 17, in from gradio_logsview import LogsView, LogsViewRunner ModuleNotFoundError: No module named 'gradio_logsview'

make sure python env is activated before running the app.py

@karachay-b
Copy link

你好专家,我的出现了这个启动错误,一直无法解决,请求帮助

I:\fluxgym>python app.py Traceback (most recent call last): File "I:\fluxgym\app.py", line 17, in from gradio_logsview import LogsView, LogsViewRunner ModuleNotFoundError: No module named 'gradio_logsview'

It is possible, that you forgot the following step in the installation (happened to me):

cd .. pip install -r requirements.txt

@yovsac
Copy link

yovsac commented Dec 11, 2024

Hello, I cant seem to start Fluxgym, I followed all the steps. (On Windows)

I get this error:

(env) C:\fluxgym>python app.py
Traceback (most recent call last):
File "C:\fluxgym\app.py", line 8, in
import gradio as gr
ModuleNotFoundError: No module named 'gradio'

(env) C:\fluxgym>

Any help would be appreciated.

@C06alt1
Copy link

C06alt1 commented Dec 20, 2024

Hello, I cant seem to start Fluxgym, I followed all the steps. (On Windows)

I get this error:

(env) C:\fluxgym>python app.py Traceback (most recent call last): File "C:\fluxgym\app.py", line 8, in import gradio as gr ModuleNotFoundError: No module named 'gradio'

(env) C:\fluxgym>

Any help would be appreciated.

maybe doing this might help

#274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants