cocktailpeanut / fluxgym

Dead simple FLUX LoRA training UI with LOW VRAM support
1.26k stars 104 forks source link

unable to launch Fluxgym #101

Open chnisar515 opened 1 month ago

chnisar515 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

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 commented 1 month ago

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

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 commented 1 month ago

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

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