Skip to content
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

Possible conflict between EfficientLPS & EfficientPS #407

Closed
ad-daniel opened this issue Feb 13, 2023 · 6 comments · Fixed by #410
Closed

Possible conflict between EfficientLPS & EfficientPS #407

ad-daniel opened this issue Feb 13, 2023 · 6 comments · Fixed by #410
Assignees
Labels
bug Something isn't working

Comments

@ad-daniel
Copy link
Collaborator

Describe the Bug

When installing the toolkit from the develop branch I get this error:

ERROR: Cannot install geffnet 1.0.1 (from /home/daniel/opendr/src/opendr/perception/panoptic_segmentation/efficient_lps/algorithm/EfficientLPS/efficientNet) and geffnet 1.0.1 (from /home/daniel/opendr/src/opendr/perception/panoptic_segmentation/efficient_ps/algorithm/EfficientPS/efficientNet) because these package versions have conflicting dependencies.

The conflict is caused by:
    The user requested geffnet 1.0.1 (from /home/daniel/opendr/src/opendr/perception/panoptic_segmentation/efficient_lps/algorithm/EfficientLPS/efficientNet)
    The user requested geffnet 1.0.1 (from /home/daniel/opendr/src/opendr/perception/panoptic_segmentation/efficient_ps/algorithm/EfficientPS/efficientNet)

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Which is very odd since they're the same version. @vniclas @aselimc Is there a difference between the two tools that could cause this problem?

@ad-daniel ad-daniel added the bug Something isn't working label Feb 13, 2023
@vniclas
Copy link
Collaborator

vniclas commented Feb 13, 2023

I believe they are the same, i.e., in one of the requirements files we should just point to the other location. @aselimc will look into this tomorrow.

@aselimc
Copy link
Collaborator

aselimc commented Feb 13, 2023

I think they are the same as well. I will try to solve this tomorrow. Sorry for the inconvenience

@aselimc aselimc self-assigned this Feb 14, 2023
@aselimc
Copy link
Collaborator

aselimc commented Feb 14, 2023

@ad-daniel Can we make assumption that if a user wants to use our toolkit, all of our submodules are needed to be fetched ? Since both EfficientPS and EfficientLPS uses geffnet 1.0.1, I can simply point the other location (which solves the problem) but this will lead to an issue if user only wants to use one of these tools and not install the other one at all.

@ad-daniel
Copy link
Collaborator Author

The toolkit can be installed as a whole or by modules. However in the case of those two, both tools belong to the same module namely perception/panoptic_segmentation. As such yes, I think since you can't currently install one without the other, therefore I think you can go ahead with that assumption and fix.
Thanks for looking into this!

@aselimc
Copy link
Collaborator

aselimc commented Feb 14, 2023

I think we can have one more option (because even though EfficientPS and EfficientLPS are both in perceoption/panoptic_segmentation, they can be both used seperately). I can also add the following into dependencies/parse_dependencies.py, which will prevent adding the same dependency into wheel. The modified code inside the file dependencies/parse_dependencies.py will look like this:

global flag_efficientNet
flag_efficientNet = False

python_prerequisites_file = "python_prerequisites.txt"
python_file = "python_dependencies.txt"
linux_file = "linux_dependencies.txt"

def read_ini(path):
    opendr_device = os.environ.get('OPENDR_DEVICE', default='cpu')
    parser = ConfigParser()
    parser.read(path)
    def read_ini_key(key, summary_file):
        tool_device = parser.get('device', 'opendr_device', fallback='cpu')
        if opendr_device == 'cpu' and tool_device == 'gpu':
            return
        if parser.has_option(section, key):
            dependencies = parser.get(section, key)
            if dependencies:
                for package in dependencies.split('\n'):
                    if "efficientNet" in package:
                        global flag_efficientNet
                        if flag_efficientNet:
                            continue
                        else:
                            flag_efficientNet = True
                    with open(summary_file, "a") as f:
                        f.write(os.path.expandvars(package) + '\n')
    read_ini_key('python-dependencies', python_prerequisites_file)
    read_ini_key('python', python_file)
    read_ini_key('linux', linux_file)

Would you suggest to go with the assumption or this fix @ad-daniel ?

By the way sorry for the long texts

@ad-daniel
Copy link
Collaborator Author

Good point, I think changing the parse_dependencies.py to include it only once is a good idea. It seems to do the trick on my machine so you can go ahead with that patch. By the way, install_nvidia.sh needs to be adapted accordingly too

@aselimc aselimc closed this as completed Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants