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

module 'os' has no attribute 'getuid' #160

Open
tyf0416 opened this issue Sep 19, 2022 · 8 comments
Open

module 'os' has no attribute 'getuid' #160

tyf0416 opened this issue Sep 19, 2022 · 8 comments

Comments

@tyf0416
Copy link

tyf0416 commented Sep 19, 2022

When I tested the library on my laptop with the Windows system, the error information is shown below. I searched for the problem, and it seems that os.getuid is only applicable in Unix systems.
_> s_elf.container_dir = self.cache_dir / f'hpobench-{os.getuid()}'

AttributeError: module 'os' has no attribute 'getuid'_

So, my question is:

  • Can I use the HPOBench library on Windows? Or I need to use it on a Linux system.
    Regards
@Neeratyoy
Copy link
Collaborator

Which benchmarks are you using?
Are they the Raw benchmarks? Are they running on Windows?

@tyf0416
Copy link
Author

tyf0416 commented Sep 21, 2022

I tested the demo code provided in the README on Windows.

from hpobench.container.benchmarks.nas.tabular_benchmarks import SliceLocalizationBenchmark
b = SliceLocalizationBenchmark(rng=1)
config = b.get_configuration_space(seed=1).sample_configuration()
result_dict = b.objective_function(configuration=config, fidelity={"budget": 100}, rng=1)

@PhMueller
Copy link
Collaborator

Hi,
at the moment, we only support linux os.
I am unsure if the used tech stack (singularity, pyro, ...) works on windows. So it is likely that we also will not add windows support in the future.

Have you tried to run it in WSL? I am curious to hear if that works :-)

@Meganton
Copy link

Meganton commented Feb 18, 2023

I had the same problem, after installing hpobench, i could not import anything from HPOBench on my windows laptop without getting the error. My workaround was to make a local clone of HPOBench and change just the line where the error occured.
It is only used to first setup HPOBench, in HPOBench/hpobench/config.py, Line 67, i think to setup a temporary directory for the initialization process.
self.container_dir = self.cache_dir / f'hpobench-{os.getuid()}'
When i replaced the line with
self.container_dir = self.cache_dir / f'hpobench-{Test}'
It worked, i could import and run for example the mentioned README-example or the NN-Benchmark from hpobench/benchmarks/ml/.
I don't know, wether this could be the base for an easy fix, but it worked for me.

@Neeratyoy
Copy link
Collaborator

This seems like an open issue so running our code on Windows would run into this issue.
Since we are not offering Windows support as of now, the solution of fixing the directory manually and a local install as suggested by @Meganton should work.

@PhMueller could offer a sanity check and advise on if there might be any downstream effect of such a change.

@PhMueller
Copy link
Collaborator

Fixed in #170

@PhMueller
Copy link
Collaborator

PhMueller commented Feb 22, 2023

At least the getuid() one.
I don't have tested it with pyro and containers, but it seems like that @Meganton has successfully used it.

I leave that one here open for now. It would be awesome if you could share if it works for you now :-)

@Meganton
Copy link

Meganton commented Feb 23, 2023

Thank you for the fix @PhMueller ! It works for me now, but i could not test anything with singularity yet, since I don't have it installed. But the ml benchmarks work, so it's perfectly fine for my usecase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants