Skip to content

python3 -m torch.utils.collect_env not providing expected output. #147669

@chowdri

Description

@chowdri

I'm using the following guide to install pytorch on my computer (elementaryOS 7.1 / Ubuntu 22.04.5):

https://rocm.docs.amd.com/projects/radeon/en/latest/docs/install/native_linux/install-pytorch.html

I have installed pytorch using pip.

The process goes as expected until I use the following command to verify installation:

$ python3 -m torch.utils.collect_env

I get the following output:

/usr/lib/python3.10/runpy.py:126: RuntimeWarning: 'torch.utils.collect_env' found in sys.modules after import of package 'torch.utils', but prior to execution of 'torch.utils.collect_env'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))
Collecting environment information...
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/praful/.local/lib/python3.10/site-packages/torch/utils/collect_env.py", line 651, in <module>
    main()
  File "/home/praful/.local/lib/python3.10/site-packages/torch/utils/collect_env.py", line 634, in main
    output = get_pretty_env_info()
  File "/home/praful/.local/lib/python3.10/site-packages/torch/utils/collect_env.py", line 629, in get_pretty_env_info
    return pretty_str(get_env_info())
  File "/home/praful/.local/lib/python3.10/site-packages/torch/utils/collect_env.py", line 454, in get_env_info
    pip_version, pip_list_output = get_pip_packages(run_lambda)
  File "/home/praful/.local/lib/python3.10/site-packages/torch/utils/collect_env.py", line 411, in get_pip_packages
    out = run_with_pip([sys.executable, '-mpip'])
  File "/home/praful/.local/lib/python3.10/site-packages/torch/utils/collect_env.py", line 406, in run_with_pip
    for line in out.splitlines()
AttributeError: 'NoneType' object has no attribute 'splitlines'

I have followed the guide as is, except I have used sudo for installation of packages.
As per the guide, the above output is unexpected. Any hints on what can I do differently to resolve the issue?

Much thanks for any guidance and insights.

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @hongxiayang @naromero77amd

Metadata

Metadata

Assignees

Labels

module: collect_env.pyRelated to collect_env.py, which collects system information about usersmodule: rocmAMD GPU support for PytorchtriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions