spyder中import tensorflow出現錯誤1

 前段時間安了好幾次終於成功安裝tensorflow,並且在終端和spyder中都成功import,非常的激動,今天準備用用,發現兩者都出現錯誤,在終端中老提醒我以下的問題,在spyder中出現starting die之類的,整個人不好了。後來查了查也就是需要將numpy升級,(pip install numpy --upgrade),之後就可以了。

>>> import tensorflow as tf
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.umath failed to import
ImportError: numpy.core.umath failed to import
2018-11-05 16:08:55.513923: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr
(tensorflow) C:\Users\2018061801>pip install numpy --upgrade
Collecting numpy
  Downloading https://files.pythonhosted.org/packages/a1/1a/d3491298c548870dd9c31d40f0234ff71a1f337d98581c978338d6b83d00/numpy-1.15.4-cp35-none-win_amd64.whl (13.5MB)
    100% |████████████████████████████████| 13.5MB 124kB/s
Installing collected packages: numpy
  Found existing installation: numpy 1.15.3
    Uninstalling numpy-1.15.3:
      Successfully uninstalled numpy-1.15.3
Successfully installed numpy-1.15.4
(tensorflow) C:\Users\2018061801>python
Python 3.5.4 |Continuum Analytics, Inc.| (default, Aug 14 2017, 13:41:13) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>>

 spyder中測試也可以

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
import tensorflow as tf

 還有就是安裝了tensorflow,有人說打開spyder(tensorflow)就可以, 然而我發現並不能打開,最後只能先打開Anaconda Navigator 然後選擇Applications on 下的tensorflow, 在Launch spyder纔可以, 無能爲力, 我已經絕望, 先這樣吧!

################################################################################

另外給大家推薦一個安裝tensorflow的博客,之前看了很多博客沒一個成功安裝的, 但是看了一位可愛的博主一次就成功安裝。

https://blog.csdn.net/darlingwood2013/article/details/60322258

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章