You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a user accidentally writes tfe.enable_eager_execution(tfe.DEVICE_PLACEMENT_WARN) instead of the correct tfe.enable_eager_execution(device_policy=tfe.DEVICE_PLACEMENT_WARN), they won't get an error until later in their program.
For example, tfe.num_gpus() after the incorrect enable call produces
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-71d6509178f5> in <module>()
----> 1 tfe.num_gpus()
~/anaconda3/lib/python3.6/site-packages/tensorflow/python/eager/context.py in num_gpus()
458 The number of available GPU devices.
459 """
--> 460 return context().num_gpus()
~/anaconda3/lib/python3.6/site-packages/tensorflow/python/eager/context.py in num_gpus(self)
286 def num_gpus(self):
287 """The number of GPUs available to execute operations."""
--> 288 self._initialize_handle_and_devices()
289 return self._num_gpus
290
~/anaconda3/lib/python3.6/site-packages/tensorflow/python/eager/context.py in _initialize_handle_and_devices(self)
121 with errors.raise_exception_on_not_ok_status() as status:
122 if self._config is not None:
--> 123 config_str = self._config.SerializeToString()
124 pywrap_tensorflow.TFE_ContextOptionsSetConfig(
125 opts, config_str, len(config_str), status)
AttributeError: 'int' object has no attribute 'SerializeToString'
I'd think it makes more sense to throw an error immediately after the incorrect enable_eager_execution.
If a user accidentally writes
tfe.enable_eager_execution(tfe.DEVICE_PLACEMENT_WARN)
instead of the correcttfe.enable_eager_execution(device_policy=tfe.DEVICE_PLACEMENT_WARN)
, they won't get an error until later in their program.For example,
tfe.num_gpus()
after the incorrect enable call producesI'd think it makes more sense to throw an error immediately after the incorrect
enable_eager_execution
.This is on
master
(ab00df9).The text was updated successfully, but these errors were encountered: