-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
When using xformers in Ubuntu, it couldn't find the forward function replacement (removing --xformers works) #1
Comments
Traceback (most recent call last): |
Same problem here, on Windows. |
@cian0 can you try to install xformers for linux in your venv with:
Not sure if this is how you installed it. It will take about 20 minutes to compile everything for your specific card. |
Did xformer installed without error on your system? Are you running python 3.10.6? Try intalling it again with |
Yes, xformers works correctly for me in other repos, like stable-diffusion-webui. |
Please use python 3.10 , I noticed your errors are all pointing to 3.9 |
I use python3.8.10 in ubuntu20.04, I fix the error by refer to stable diffusion,torch==1.13.1+cu117 and xformers==0.0.16rc425, I modify the ubuntu_setup.sh pip install --use-pep517 --upgrade -r requirements.txt accelerate config echo -e "setup finished! run \e[0;92m./gui.sh\e[0m to start" |
On windows that particular version tend to lead to NaN when training... Watch out. If your loss goes to NaN it is probably the reason... |
Proposed file structure rework and required file changes
Sync with origin
libs installed:
xformers 0.0.14.dev0
torch 1.13.0
Stack trace:
Traceback (most recent call last): File "/home/ian/repositories/kohya_ss/train_db_fixed_v7.py", line 1609, in <module> train(args) File "/home/ian/repositories/kohya_ss/train_db_fixed_v7.py", line 1248, in train noise_pred = unet(noisy_latents, timesteps, encoder_hidden_states).sample File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(*input, **kwargs) File "/home/ian/miniconda3/lib/python3.9/site-packages/accelerate/utils/operations.py", line 507, in __call__ return convert_to_fp32(self.model_forward(*args, **kwargs)) File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/amp/autocast_mode.py", line 14, in decorate_autocast return func(*args, **kwargs) File "/home/ian/miniconda3/lib/python3.9/site-packages/diffusers/models/unet_2d_condition.py", line 296, in forward sample, res_samples = downsample_block( File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(*input, **kwargs) File "/home/ian/miniconda3/lib/python3.9/site-packages/diffusers/models/unet_2d_blocks.py", line 563, in forward hidden_states = attn(hidden_states, context=encoder_hidden_states) File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(*input, **kwargs) File "/home/ian/miniconda3/lib/python3.9/site-packages/diffusers/models/attention.py", line 169, in forward hidden_states = block(hidden_states, context=context) File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(*input, **kwargs) File "/home/ian/miniconda3/lib/python3.9/site-packages/diffusers/models/attention.py", line 217, in forward hidden_states = self.attn1(self.norm1(hidden_states)) + hidden_states File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(*input, **kwargs) File "/home/ian/repositories/kohya_ss/train_db_fixed_v7.py", line 1552, in forward_xformers return self.to_out(out) File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl return forward_call(*input, **kwargs) File "/home/ian/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 244, in _forward_unimplemented raise NotImplementedError(f"Module [{type(self).__name__}] is missing the required \"forward\" function") NotImplementedError: Module [ModuleList] is missing the required "forward" function steps: 0%| | 0/2200 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/ian/miniconda3/bin/accelerate", line 8, in <module> sys.exit(main()) File "/home/ian/miniconda3/lib/python3.9/site-packages/accelerate/commands/accelerate_cli.py", line 43, in main args.func(args) File "/home/ian/miniconda3/lib/python3.9/site-packages/accelerate/commands/launch.py", line 837, in launch_command simple_launcher(args) File "/home/ian/miniconda3/lib/python3.9/site-packages/accelerate/commands/launch.py", line 354, in simple_launcher raise subprocess.CalledProcessError(returncode=process.returncode, cmd=cmd)
The text was updated successfully, but these errors were encountered: