benchmarks
benchmarks copied to clipboard
ImportError: cannot import name interleave_ops
After I pull and merge the latest commit, I got the ImportError
. I attached the error log as below:
Traceback (most recent call last):
File "tf_cnn_benchmarks.py", line 26, in <module>
import benchmark_cnn
File ".../benchmarks/scripts/tf_cnn_benchmarks/benchmark_cnn.py", line 43, in <module>
import datasets
File ".../benchmarks/scripts/tf_cnn_benchmarks/datasets.py", line 28, in <module>
import preprocessing
File ".../benchmarks/scripts/tf_cnn_benchmarks/preprocessing.py", line 23, in <module>
from tensorflow.contrib.data.python.ops import interleave_ops
ImportError: cannot import name interleave_ops
I reviewed the commit and found the latest merged code causing the error. You can find my comment here, and the code here
It's added to tensorflow only a couple of days ago. You'll need to use latest tensorflow.
@ppwwyyxx Thanks! If so, I think I have to update my TensorFlow version to 1.4 release. My TensorFlow base is 1.4-rc1, whose GitHub hash is 358298
.
Unfortunately updating to tensorflow 1.4 is not enough, I have the same error with TF 1.4
Commenting that single line
//from tensorflow.contrib.data.python.ops import interleave_ops
is a quick-fix, if you need only synthetic.
By "latest tensorflow" I mean something that's built within this week.
TF 1.4 came out 18 hours ago, it would be nice if benchmarks could use that version.
OK..I should say built with the latest source code from master branch within this week.
1.4 was released with earlier version of the source code plus some cherry picks.
You can use pip install tf-nightly-gpu
, to get the latest.
This bug is really frustrated. It's still in the latest pip release when using Ubuntu 16 or CentOS 7.
Caused so much damage.
@ppwwyyxx Is there a official guide or temporary solution?
As @ppwwyyxx, you unfortunately need to use the nightly TensorFlow version, which you can get by running
pip install tf-nightly-gpu
Alternatively, you can build from source. Using the latest stable version, which is currently TensorFlow 1.4, will not work.
We develop tf_cnn_benchmarks on the nightly version of TensorFlow, so we can quickly use and benchmark new features of TensorFlow before they are released. But ideally we would have a branch of tf_cnn_benchmarks which works on the latest stable version of TensorFlow. I will try to set that up in the future, perhaps starting with TensorFlow 1.5 when it comes out.
@reedwm Thanks for your replying! I'd like to build from source on a stable version. Look forward to the stable testing branch of tf_cnn_benchmarks
.
@reedwm I've installed latest TF using
pip install tf-nightly-gpu
as suggested and got:
Successfully installed astor-0.6.2 gast-0.2.0 tb-nightly-1.5.0a20180114 termcolor-1.1.0 tf-nightly-gpu-1.6.0.dev20180114
(tensorflow_p27) ubuntu@ip-172-31-9-87:/mnt/weka/benchmarks/scripts/tf_cnn_benchmarks$ python2 tf_cnn_benchmarks.py --help
Traceback (most recent call last):
File "tf_cnn_benchmarks.py", line 25, in
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_problems
for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.
@bentsi make sure you have Cuda 9.0 installed. Tensorflow nightly does not work with earlier versions of Cuda, nor Cuda 9.1.