I have an issue where I have two git repositories ( AdaBins
, BLIP
) that have the same package name models
that I'm trying to import and use in the same run. It appears that when I import one of the packages, the namespace gets locked, preventing me from using functions from the same package.
AdaBins.infer
ends up calling a function that uses the init.py
file inside BLIP
instead of AdaBins
, which is how it normally works.
I can fix it if I rename one of the packages to something else other than models
and update all the from models
in the repo, but obviously I'd prefer not to modify an outside dependency. I know this is somewhat anti-python but other than renaming the models, I'm just not too sure what to do, or how to properly do it.
Here is the file-structure:
- disco-investigator.ipynb
- BLIP
- models
- __init__.py
- blip.py
- AdaBins
- models
- __init__.py
- unet_adaptive_bins.py
I've tried the whole sys.path.append
, sys.path.remove
, del sys.modules
for each package, but it doesn't seem to resolve my issue at all.
I had the same issue but solved it with the axe. I forked and refactored that folder. I did fork it quite some time ago already and it never changed until now so I hope it is kinda stable for quite some time. But now I can use it aside from Blip. if you like feel free to use my fork https://github.com/osi1880vr/AdaBins
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.