You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raising some issues I found when running ControlNet with Python 3.11 and PyTorch 2.0. The changes required to run with these versions this are outlined below:
Fix 1:
Encountered a ValueError when running python tool_add_control_sd21.py ./models/v2-1_768-ema-pruned.ckpt ./models/control_sd21_ini.ckpt.
Error message:
ValueError:mutabledefault<class'timm.models.maxxvit.MaxxVitConvCfg'> for field conv_cfg is not allowed: use default_factory
Most of the speedup during training and inference will be by manually adding the new optimization techniques. This PR serves as a bare bones setup of the latest python/pytorch version and the rest is really up to the end user.
@tensorneko Hi, I am using version 1.5, and I followed your modifications. It worked fine. I encountered an error related to the missing dataloader_idx, thus I did anything with that part. I am not certain if this issue is due to differences between versions 1.5 and 2.1. Additionally, perhaps you could include your changes in the tutorial_train.py file. Furthermore, maybe torch.compile could be incorporated in your pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Raising some issues I found when running ControlNet with Python 3.11 and PyTorch 2.0. The changes required to run with these versions this are outlined below:
Fix 1:
Encountered a ValueError when running python tool_add_control_sd21.py ./models/v2-1_768-ema-pruned.ckpt ./models/control_sd21_ini.ckpt.
Error message:
Solution:
Implemented the fix from the following commit in HuggingFace's PyTorch Image Models repository:
huggingface/pytorch-image-models@a482365
Alternatively, you can use the pre-release version of timm by running pip install --pre timm.
Fix 2:
Encountered an ImportError for rank_zero_only from pytorch_lightning.utilities.distributed.
Replace:
With:
Fix 3:
remove dataloader_idx param in 'ImageLogger' and 'def on_train_batch_start(self, batch, batch_idx):'
Then you can train successfully with Python 3.11 and PyTorch 2.0, also added cpu core variable for more efficient data loading.