Fix AttributeError when accessing profile_idx of NoneType#259
Merged
contentis merged 1 commit intoNVIDIA:devfrom Feb 5, 2024
Merged
Fix AttributeError when accessing profile_idx of NoneType#259contentis merged 1 commit intoNVIDIA:devfrom
contentis merged 1 commit intoNVIDIA:devfrom
Conversation
|
Thanks for this, got tired of seeing that stupid error for the last month and came looking for a fix. |
contentis
added a commit
that referenced
this pull request
Mar 13, 2024
* fix typo (#79) * Faster and simplified install * Print correct profile when engine is loaded * Use scripts callbacks * increase max resolution * adding native LoRA support, avoiding model.py import error and some refactoring * more refactoring and added typing * Enable torch fallback * update inastall * change default XL engine * cc independent lora * Update Instrucitons * Fix for #225 Install.py silently blocked by blocking call of nvidia-cudnn-cu11 uninstall due to interactive python shell opening (#226) * v0.2.0 (#217) * fix typo (#79) * Print correct profile when engine is loaded * Use scripts callbacks * increase max resolution * adding native LoRA support, avoiding model.py import error and some refactoring * more refactoring and added typing * Enable torch fallback * update inastall * change default XL engine * cc independent lora * Update Instrucitons --------- Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Fix subprocess blocking issue when installing --------- Co-authored-by: Luca <lspindler@nvidia.com> Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Resolve AttributeError on generation without Unet (#224) * v0.2.0 (#217) * fix typo (#79) * Print correct profile when engine is loaded * Use scripts callbacks * increase max resolution * adding native LoRA support, avoiding model.py import error and some refactoring * more refactoring and added typing * Enable torch fallback * update inastall * change default XL engine * cc independent lora * Update Instrucitons --------- Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Resolve AttributeError on generation without Unet --------- Co-authored-by: Luca <lspindler@nvidia.com> Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> * Fixes crashes cause by lora checkpoint configs missing sd version (#251) During the initial Lora loading process, if a config for a specified **.safetensor** file does not contain the property **"sd version"**, the plugin crashes and does not show the trt tab. fixes the issue by inferencing the model version as unknown * Fix AttributeError when accessing profile_idx of NoneType (#259) * fix #157 --------- Co-authored-by: Rudra <92840555+Rudra-Ji@users.noreply.github.com> Co-authored-by: Andrew Vuong <andrewtvuong@utexas.edu> Co-authored-by: Aether <59086566+AetherMagee@users.noreply.github.com> Co-authored-by: ZN <72399198+Zn10plays@users.noreply.github.com> Co-authored-by: Yuki Shindo <shinshin86@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR addresses an issue that was causing an AttributeError when trying to access the profile_idx attribute of sd_unet.current_unet, which was None.
The error was as follows:
This error occurred when sd_unet.current_unet was None. Trying to reference sd_unet.current_unet.profile_idx resulted in an AttributeError because the NoneType object does not have a profile_idx attribute.
To fix this issue, I added a condition to check if sd_unet.current_unet is not None before trying to access its profile_idx attribute. This prevents the AttributeError from being raised when sd_unet.current_unet is None.
Please review this fix and let me know if there are any issues or further changes needed.