Repository navigation
Closed
Labels
comp:eagerEager related issuesstat:awaiting tensorflowerStatus - Awaiting response from tensorflowertype:bugBug
Description
Please go to Stack Overflow for help and support:
If you open a GitHub issue, here is our policy:
- It must be a bug or a feature request.
- The form below must be filled out.
- It shouldn't be a TensorBoard issue. Those go here.
Here's why we have that policy: TensorFlow developers respond to issues. We want to focus on work that benefits the whole community, e.g., fixing bugs and adding features. Support only helps individuals. GitHub also notifies thousands of people when issues are filed. We want them to see you communicating an interesting problem, rather than being redirected to Stack Overflow.
== cat /etc/issue ===============================================
Darwin Xiaoyuns-MBP 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
Mac OS X 10.11.4
== are we in docker =============================================
No
== compiler =====================================================
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
== uname -a =====================================================
Darwin Xiaoyuns-MBP 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
== check pips ===================================================
numpy (1.11.2)
protobuf (3.4.0)
== check for virtualenv =========================================
False
== tensorflow import ============================================
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named tensorflow
== env ==========================================================
LD_LIBRARY_PATH is unset
DYLD_LIBRARY_PATH /usr/local/cuda/lib:/usr/local/cuda/lib:
== nvidia-smi ===================================================
/Users/xiaoyun/tf14py3/bin/tf_env_collect.sh: line 105: nvidia-smi: command not found
== cuda libs ===================================================
== cat /etc/issue ===============================================
Darwin Xiaoyuns-MBP 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
Mac OS X 10.11.4
== are we in docker =============================================
No
== compiler =====================================================
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
== uname -a =====================================================
Darwin Xiaoyuns-MBP 15.4.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
== check pips ===================================================
numpy (1.11.2)
protobuf (3.4.0)
== check for virtualenv =========================================
False
== tensorflow import ============================================
tf.VERSION = 1.5.0-rc1
tf.GIT_VERSION = v1.5.0-rc0-9-gf9472619f6
tf.COMPILER_VERSION = v1.5.0-rc0-9-gf9472619f6
Sanity check: array([1], dtype=int32)
== env ==========================================================
LD_LIBRARY_PATH is unset
DYLD_LIBRARY_PATH /usr/local/cuda/lib:/usr/local/cuda/lib:
== nvidia-smi ===================================================
/Users/xiaoyun/tf14py3/bin/tf_env_collect.sh: line 105: nvidia-smi: command not found
== cuda libs ===================================================
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- TensorFlow installed from (source or binary):
- TensorFlow version (use command below):
- Python version:
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version:
- GPU model and memory:
- Exact command to reproduce:
You can collect some of this information using our environment capture script:
You can obtain the TensorFlow version with
python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
v1.5.0-rc0-9-gf9472619f6 1.5.0-rc1
Describe the problem
Can not use hashtable in eager mode.
Source code / logs
import tensorflow as tf
import tensorflow.contrib.eager as tfe
tfe.enable_eager_execution()
keyfile = "./key_dict"
kv_initializer = tf.contrib.lookup.TextFileInitializer(
keyfile, tf.string, 0, tf.int64, 1, delimiter="\t")
table = tf.contrib.lookup.HashTable(kv_initializer, 0)
table.init.run()
filenames = ["./data1"]
dataset = tf.data.TextLineDataset(filenames)
#dataset = dataset.map(lambda tkns:table.lookup(tkns))
for x in tfe.Iterator(dataset):
print(x)
Traceback (most recent call last):
File "torch/textline.py", line 13, in <module>
table = tf.contrib.lookup.HashTable(kv_initializer, 0)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/ops/lookup_ops.py", line 282, in __init__
super(HashTable, self).__init__(table_ref, default_value, initializer)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/ops/lookup_ops.py", line 168, in __init__
self._init = initializer.initialize(self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/ops/lookup_ops.py", line 531, in initialize
if constant_op.is_constant(filename):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/constant_op.py", line 224, in is_constant
op = tensor_or_op.op
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 825, in op
raise AttributeError("op not supported for Eager Tensors.")
AttributeError: op not supported for Eager Tensors.
Metadata
Metadata
Assignees
Labels
comp:eagerEager related issuesstat:awaiting tensorflowerStatus - Awaiting response from tensorflowertype:bugBug
Activity
aselle commentedon Jan 16, 2018
@alextp, please comment/take a look.
Improves the eager compatibility with tf.contrib.lookup.
xiaoyunwu commentedon Jan 18, 2018
thanks for the fix. But now
And if I comment this out,
give this:
alextp commentedon Jan 18, 2018
xiaoyunwu commentedon Jan 19, 2018
it is the same code that still failing... I do not get the reason for file another issue.
alextp commentedon Jan 19, 2018
Fixes issue with using lookup ops in datasets from eager.