AttributeError: 'tuple' object has no attribute 'type' upon importing tensorflow

前端 未结 4 1741
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 12:40

I installed the Tensorflow(-gpu) version 1.8.0 as a pip package following these instructions. Upon installation, I opened a python3 console and typed in

impo         


        
相关标签:
4条回答
  • 2021-01-18 13:15

    In fact, this means you have multiple versions of numpy installed somehow (or there are multiple versions that are overlapping). You need to make sure that numpy is fully uninstalled from your system, then reinstall.

    For me, I did

    pip uninstall numpy
    sudo apt-get purge python3-numpy
    

    Then I had to go to /usr/local/lib/python3.6/dist-packages and delete the numpy folders that were still there for some reason. After that, reinstalling numpy with

    pip install numpy
    

    worked. Here is the github issue I opened on it:

    https://github.com/numpy/numpy/issues/12775

    0 讨论(0)
  • 2021-01-18 13:26

    I can't help you but I can point out another thread with a similar issue: Error with calling Numpy, Scipy, Gensim in python3

    0 讨论(0)
  • 2021-01-18 13:33

    Had the same issue, fixed by going back to Numpy 1.15.4 Thanks wordsforthewise

    0 讨论(0)
  • 2021-01-18 13:39

    This is slightly late, but for anyone running into this issue, what fixed it for me was going into my /anaconda3/lib/python3.X/site-packages folder and manually removing numpy there. Replace python3.X with you version of course.

    I also followed Wordsforthewise' suggestion and ran his first two commands before reinstalling numpy via pip. I ran into this problem on a google cloud shell.

    0 讨论(0)
提交回复
热议问题