Giter Site home page Giter Site logo

Comments (26)

Red-Eyed avatar Red-Eyed commented on August 26, 2024 91

I've dealt with this problem (in conda env on Ubuntu 18.04):

pip uninstall tensorflow protobuf --yes
find $CONDA_PREFIX -name "tensorflow" | xargs -Ipkg rm -rfv pkg
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp36-cp36m-linux_x86_64.whl --no-cache-dir

from probability.

matthew-mcateer avatar matthew-mcateer commented on August 26, 2024 63

This appeared to be fixable with the following steps:

  1. uninstalling tensorflow
  2. uninstalling protobuf
  3. reinstalling tensorlfow (which should come along with the correct protobuf version.

from probability.

strubell avatar strubell commented on August 26, 2024 17

FWIW if you're using a local install (pip install --user) rather than conda you can replace the second command with this:
find ~/.local/ -name "tensorflow" | xargs -Ipkg rm -rfv pkg

from probability.

AramNasser avatar AramNasser commented on August 26, 2024 15

The problem is that you updated the tensorflow but not tensorflow_gpu.

pip install --upgrade tensorflow
pip install --upgrade tensorflow-gpu

Best wishes.

from probability.

pascalwhoop avatar pascalwhoop commented on August 26, 2024 13

I suspect this is not fixed by the protobuf version but rather by the reinstall of tensorflow which installs 1.8.0 I assume. I built 1.9.0 from source and see the same error.

What I can see is that the _impl folder is missing under the site-packages folder of the keras package included in tensorflow. hence, the resolution fails.

But it seems to have something to do with this commit

manually deleting the tensorflow folder inside the virtual environment and reinstalling the locally installed variant helped. I assume it has something to do with __pycache__ files.

from probability.

addisaden avatar addisaden commented on August 26, 2024 12

I got the problem too. Tensorflow 1.8.0 was installed as sudo and Tensorflow 1.10.0 installed as user triggered the problem.

sudo pip3 uninstall tensorflow
pip3 install tensorflow

solved it.

from probability.

Dok11 avatar Dok11 commented on August 26, 2024 6

@rodrigob did you found solution?
I have same error (windows 10, anaconda) at from keras import backend as K

  File "\Anaconda3\envs\art\lib\site-packages\tensorflow\python\keras\engine\__init__.py", line 21, in <module>
    from tensorflow.python.keras.engine.base_layer import InputSpec
  File "\Anaconda3\envs\art\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 33, in <module>
    from tensorflow.python.keras import backend
  File "\Anaconda3\envs\art\lib\site-packages\tensorflow\python\keras\backend\__init__.py", line 22, in <module>
    from tensorflow.python.keras._impl.keras.backend import abs
ImportError: cannot import name 'abs'

from probability.

Dok11 avatar Dok11 commented on August 26, 2024 4

@Tarunyellogi I installed 1.8 instead 1.9 and its worked for me

from probability.

sraddhanjali avatar sraddhanjali commented on August 26, 2024 3

Deleting the virtualenv which stored caches of tensorflow installation did the trick. Making a new env, and then installing tensorflow again likely installed the packages afresh.

from probability.

PallawiSinghal avatar PallawiSinghal commented on August 26, 2024 1

Hello everyone,
Please make a new environment. I was struggling the whole day with this problem. I was about to quit but for the last time I decided to create a new environment and it worked.

from probability.

assaad avatar assaad commented on August 26, 2024

which protobuf version is supported? thanks!

from probability.

SCIUGU avatar SCIUGU commented on August 26, 2024

hi, I got the same problem with my program, but neither reinstalling tf nor deleting the folder worked.
I have problems with installing via web, so I download the wheel files of the modules and use pip install locally.
I'm trying to run tf 1.9.0 and I'm trying with all the latest releases of the submodules.
any hints on what to try?

from probability.

SCIUGU avatar SCIUGU commented on August 26, 2024

thank you very much

from probability.

guotong1988 avatar guotong1988 commented on August 26, 2024

Thank you!

from probability.

jasperzhong avatar jasperzhong commented on August 26, 2024

I also encounter this problem. I have installed tensorflow 1.8.0 before and I just pip install tensorflow-gpu==1.9.0.
Then import tensorflow as tf, I saw this error.
So I uninstall tensorflow 1.8.0 and reinstall tensorflow-gpu 1.9.0.
And the error is gone! The problem is solved.

from probability.

rodrigob avatar rodrigob commented on August 26, 2024

Same problem. Uninstalling & reinstalling did not help :(

from probability.

coolsgupta avatar coolsgupta commented on August 26, 2024

Hi,
I am using tensorflow 1.10.0
I agree with matthew-mcateer, It worked on my machine by uninstalling tensorflow and protobuf and reinstalling tensorflow.

from probability.

strubell avatar strubell commented on August 26, 2024

@rdinse good point -- the original solution also has this problem (except for conda). I guess if you have more important things in .local then you should rm with more care :)

from probability.

Tarunyellogi avatar Tarunyellogi commented on August 26, 2024

Hey Dok11 , im getting the same error, please ping me if you got any solution for that.
https://www.linkedin.com/in/tarun-yellogi-51b41466/

from probability.

christojet avatar christojet commented on August 26, 2024

I have the same issue that Dok11 and Tarunyellogi

from probability.

pratham16 avatar pratham16 commented on August 26, 2024

Deleting directories of older tensorflow installations (after uninstalling tf) and then installing tf-1.10.0 worked for me.

from probability.

yahyadogan72 avatar yahyadogan72 commented on August 26, 2024

Hi,
1-) conda uninstall tensorflow-gpu and conda uninstall protobuf,
2-) Deleting directories of older tensorflow installations,
3-) conda install tensorflow-gpu==1.8
worked for me.

but, conda install tensorflow-gpu==1.10 not worked for me.

from probability.

alexcpn avatar alexcpn commented on August 26, 2024

The answer from AramNaseer solved this . But when I upgraded the tensofflow and tensorflow-gpu got this error - tensorflow cannot load libcublas.so.9 (I had cuda 8 installed, now need to upgrade it and hope everything else works)

"As our installation pages list, prebuilt TF pip packages on pypi are built with CUDA 9.0 support only:
https://www.tensorflow.org/install/gpu"

tensorflow/tensorflow#20569 (comment)

from probability.

sidharthskumar avatar sidharthskumar commented on August 26, 2024

how to create a new environment

from probability.

yustiks avatar yustiks commented on August 26, 2024

I got the problem too. Tensorflow 1.8.0 was installed as sudo and Tensorflow 1.10.0 installed as user triggered the problem.

sudo pip3 uninstall tensorflow
pip3 install tensorflow

solved it.

worked for me

from probability.

sohel5100 avatar sohel5100 commented on August 26, 2024

This appeared to be fixable with the following steps:

  1. uninstalling tensorflow
  2. uninstalling protobuf
  3. reinstalling tensorlfow (which should come along with the correct protobuf version.

worked for me

  1. pip uninstall tensorflow
  2. pip uninstall protobuf
  3. pip install tensorflow==1.4.0

from probability.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.