[go: nahoru, domu]

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

device_spec from_string method not accepting some inputs #39857

Open
philippeller opened this issue May 25, 2020 · 8 comments
Open

device_spec from_string method not accepting some inputs #39857

philippeller opened this issue May 25, 2020 · 8 comments
Assignees
Labels
comp:gpu GPU related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.11 Issues related to TF 2.11 type:bug Bug

Comments

@philippeller
Copy link

The method from_string of tensorflow.python.framework.device_spec does not accept device names reported by tf itself:

tf.config.list_physical_devices() returns device names of the form '/physical_device:GPU:0', However from_string does not accept this as input. Only works when '/physical_device:' is cut out.

Expected behaviour:

tensorflow.python.framework.device_spec.DeviceSpecV2().from_string('/physical_device:GPU:0')
<tensorflow.python.framework.device_spec.DeviceSpecV2 at 0x7f7ec46fe8a0>

Actual behaviour:

tensorflow.python.framework.device_spec.DeviceSpecV2().from_string('/physical_device:GPU:0')
ValueError: Unknown attribute: 'physical_device' in '/physical_device:GPU:0'
@ravikyram
Copy link
Contributor

Please provide details about what platform you are using (operating system, architecture). Also include your TensorFlow version.Please, fill issue template..Request you to share colab link or simple standalone code to reproduce the issue in our environment.It helps us in localizing the issue faster.Thanks!

@ravikyram ravikyram added the stat:awaiting response Status - Awaiting response from author label May 26, 2020
@philippeller
Copy link
Author

system: Linux 4.15.0-99-generic #100~16.04.1-Ubuntu x86_64 GNU/Linux
tensorflow-gpu v2.2.0 installed via pip
Python 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0] :: Anaconda, Inc. on linux

Minimal example:

tf.python.framework.device_spec.DeviceSpecV2().from_string(tf.config.list_physical_devices()
[0].name)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/device_spec.py", line 157, in from_string
return cls(*cls._string_to_components(spec))
File "/opt/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/device_spec.py", line 344, in _string_to_components
raise ValueError("Unknown attribute: '%s' in '%s'" % (y[0], spec))
ValueError: Unknown attribute: 'physical_device' in '/physical_device:CPU:0'

@ravikyram ravikyram added comp:gpu GPU related issues TF 2.2 Issues related to TF 2.2 and removed stat:awaiting response Status - Awaiting response from author labels May 27, 2020
@jvishnuvardhan jvishnuvardhan added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label May 28, 2020
@sanjoy
Copy link
Contributor
sanjoy commented May 28, 2020

@jaingaurav do you want to take this?

@tensorflowbutler tensorflowbutler removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label May 31, 2020
@mypey
Copy link
mypey commented Dec 7, 2020

Hi,
I encountered the same issue. My workaround is to use tf.config.list_logical_devices() instead of tf.config.list_physical_devices() but I am not really satisfied.
Any news about this problem?
Thanks!

@sushreebarsa
Copy link
Contributor

@philippeller Could you please try on latest stable version of tf 2.5 or 2.4.1 and let us know if this is still an issue.Thanks!

@sushreebarsa sushreebarsa added the stat:awaiting response Status - Awaiting response from author label Jul 3, 2021
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Jul 10, 2021
@philippeller
Copy link
Author

Hi, looks to me as this is still the same issue in tf 2.5:

>>> tf.DeviceSpec().from_string(tf.config.list_physical_devices()[0].name)                                                                                                                                                                    
raise ValueError("Unknown attribute: '%s' in '%s'" % (y[0], spec))
ValueError: Unknown attribute: 'physical_device' in '/physical_device:CPU:0'
>>> tf.__version__
'2.5.0'

@google-ml-butler google-ml-butler bot removed stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author labels Jul 12, 2021
@sushreebarsa sushreebarsa added stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.5 Issues related to TF 2.5 and removed TF 2.2 Issues related to TF 2.2 labels Aug 10, 2021
@tiruk007 tiruk007 added TF 2.11 Issues related to TF 2.11 and removed TF 2.5 Issues related to TF 2.5 labels Dec 14, 2022
@tiruk007
Copy link
Contributor
tiruk007 commented Dec 14, 2022

This issue still persists on the latest TF V2.12 and Tf-nightly. Please find the gist of 2.12 and tf-nightly for reference .
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:gpu GPU related issues stat:awaiting tensorflower Status - Awaiting response from tensorflower TF 2.11 Issues related to TF 2.11 type:bug Bug
Projects
None yet
Development

No branches or pull requests

9 participants