FedML-AI / FedML

FEDML - The unified and scalable ML library for large-scale distributed training, model serving, and federated learning. FEDML Launch, a cross-cloud scheduler, further enables running any AI jobs on any GPU cloud or on-premise cluster. Built on this library, TensorOpera AI (https://TensorOpera.ai) is your generative AI platform at scale.
https://TensorOpera.ai
Apache License 2.0
4.19k stars 786 forks source link

[MLOps] [cli] windows compatibility issue when "fedml login" #244

Open chaoyanghe opened 2 years ago

chaoyanghe commented 2 years ago
PS C:\Users\chaoy\sourcecode\FedML\python> fedml login 201 -v local
login...True, None
c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py
PS C:\Users\chaoy\sourcecode\FedML\python>
PS C:\Users\chaoy\sourcecode\FedML\python> Namespace(type='login', user='201', version='local')
Traceback (most recent call last):
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 673, in <module>
    login(args)
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 656, in login
    __login(args, args.user, args.version)
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 587, in __login
    setattr(args, "device_id", FedMLClientRunner.get_device_id())
  File "c:\users\chaoy\sourcecode\fedml\python\fedml\cli\edge_deployment\client_login.py", line 478, in get_device_id
    device_id = subprocess.Popen("dmidecode.exe -s system-uuid".split())
  File "C:\Users\chaoy\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\chaoy\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
chaoyanghe commented 2 years ago

https://github.com/FedML-AI/FedML/commit/16c78406ced7b9a17b348d709852b6107733ba44

    if "nt" in os.name:
        def GetUUID():
            cmd = 'wmic csproduct get uuid'
            uuid = str(subprocess.check_output(cmd))
            pos1 = uuid.find("\\n") + 2
            uuid = uuid[pos1:-15]
            return str(uuid)
        device_id = GetUUID()
        click.echo(device_id)
Yvonne-fedml commented 2 years ago

先出现error,然后又成功了

Image

fedml-dimitris commented 1 year ago

@chaoyanghe @Yvonne-fedml @fedml-alex is this resolved?