简体   繁体   中英

Numpy - Anaconda Tensorflow GPU Error

I have gotten myself into a cyclical dependencies issue inside of a conda build. Normally, this is why I love anaconda because these issues should be resolved. Whne I install Tensorflow GPU I get a message that numpy will be down graded:

conda install -c conda-forge tensorflow-gpu
Solving environment: done

## Package Plan ##

environment location: /home/<username>/anaconda2

added / updated specs: 
- tensorflow-gpu


The following packages will be DOWNGRADED:

blas:  1.1-openblas                          conda-forge --> 1.0-mkl              
numpy: 1.14.5-py27_blas_openblashd3ea46f_201 conda-forge [blas_openblas] --> 1.14.3-py27hcd700cb_2
scipy: 1.1.0-py27_blas_openblashd3ea46f_201  conda-forge [blas_openblas] --> 1.1.0-py27hfc37229_0

Then I test TF:

python
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 47, in <module>
    import numpy as np
ImportError: No module named numpy

so I mainually upgrade numpy:

conda install numpy

and I test again:

python
>>> import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 63, in <module>
    from tensorflow.python.framework.framework_lib import *  # pylint: disable=redefined-builtin
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/framework_lib.py", line 104, in <module>
    from tensorflow.python.framework.importer import import_graph_def
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/importer.py", line 32, in <module>
    from tensorflow.python.framework import function
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/python/framework/function.py", line 36, in <module>
    from tensorflow.python.ops import resource_variable_ops
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 35, in <module>
    from tensorflow.python.ops import variables
  File "/home/<username>/anaconda2/lib/python2.7/site-packages/tensorflow/python/ops/variables.py", line 40, in <module>
    class Variable(checkpointable.CheckpointableBase):
AttributeError: 'module' object has no attribute 'CheckpointableBase'

I dug around a bit and I found this thread : https://github.com/tensorflow/tensorflow/issues/15736 , but obviously the problem is worse now than it was then. Does anyone have a workaround?

This is not a good solution but it it what I managed to make work. On another machine I had tensorflow-gpu-1.1.0

I installed it in anaconda with:

conda install -c anaconda tensorflow-gpu=1.1.0

This version works

If anyone has a better solution I would gladly accept it as answer :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM