-
Notifications
You must be signed in to change notification settings - Fork 85
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
Cannot import name 'Network' from 'controlnet_aux.hed' #66
Comments
I think on new version ( try this, from controlnet_aux import HEDdetector
from controlnet_aux.hed import ControlNetHED_Apache2
# download the new file via .from_pretrained()
# this will download the file on huggingface cache dir
# usually ${HOME}/.cache/huggingface/hub/models--lllyasviel--Annotators
hed = HEDdetector.from_pretrained(model_repo)
model_dir = "...." # <-- find 'ControlNetHED.pth' file's directory from the cache dir
model_path = os.path.join(model_dir, "ControlNetHED.pth")
network = ControlNetHED_Apache2()
network.load_state_dict(torch.load(model_path, map_location="cpu"))
network.float().eval()
hed_detector = HEDdetector(network) |
princepride
added a commit
to princepride/JARVIS
that referenced
this issue
Apr 22, 2024
Grateful for your work! As mentioned in microsoft#233, running from controlnet_aux.hed import Network now raises an error. This is because starting from controlnet_aux version 0.06, the controlnet_aux/hed file has undergone changes. To address this, I referred to the code provided in huggingface/controlnet_aux#66 and made modifications to the original code accordingly. It's worth noting that the network-bsds500.pth model has also been replaced with ControlNetHED.pth, which can be downloaded from https://huggingface.co/lllyasviel/Annotators.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I run:
I got this error:
ImportError: cannot import name 'Network' from 'controlnet_aux.hed'
(I find init.py of "hed" folder has no 'Network' class or function.
The text was updated successfully, but these errors were encountered: