tensorflow安装及在anaconda3 Jupyter NoteBook,pycharm环境中使用

tensorflow安装

使用TensorFlow实现卷积神经网络,首先需要安装tensorflow,配置环境,在环境配置中遇到了一系列问题。
首先关于tensorflow安装,根据TensorFlow的环境配置与安装做到此博客前TensorFlow安装前一步后根据Tensorflow教程(1)Tensorflow的下载和安装从清华镜像下载的tensorflow(这样下载会比较快)之后,再次根据TensorFlow的环境配置与安装在命令行验证了tensorflow的安装是否成功,成功安装

tensorflow在anaconda3 Jupyter NoteBook中使用

安装好tensorflow环境后,在anaconda3 Jupyter Notebook中使用import tensorflow as tf报错ModuleNotFoundError: No module named 'tensorflow'在网上找了很多解决方法有的说在终端执行conda install nb_conda我弄了好久中间又出现了一些新的问题,没有成功,之后看了一篇博客在虚拟环境中运行Jupyter Notebook解决办法问题得以解决。
另外我在命令行输入jupyter notebook报错,

(tensorflow) C: Users \ jupyter notebook
E: \sof tware \rj \bi anji \Anaconda3 \1ib\site-packages \setuptools \distutils patch. py:25: UserWarning: Distutils was imported
before Setuptools. This usage is di scouraged and may exhibit undesirable behaviors or errors. Please use Setuptools ob
ects directly or at least import Setuptools first.
warnings. warn (
Traceback (most recent call last) :
File" E: \software \rj\bianji \Anaconda3 Scripts \jupyter notebook script. py,line 6,in 
from notebook. notebookapp import main
File E: \software \r j\bianji \Anaconda3\1ib\site-packages notebook \notebookapp. py,line 49, in 
from zmq. eventloop import ioloop
File" E: \software \r j\bi anji \Anaconda3\lib\site-packages\zmq\_ init_ 。 py",line 47,in 
from zmq import backend
File" E: \software\rj\bianji \Anaconda3\lib\site-packages \zmq \backend\_ init_ py", line 40, in 
reraise (*exc_ info
File” E: \software \rj\bianji \Anaconda3\1ib\site-packages \zmq \utils\sixcerpt.py", line 34,in reraise
raise value
File" E: \software \rj\bi anji Anaconda3 \1ib\site-packages \zmq backend\_ init_ py ,line 27,in 
_ns 三select_ backend (first)
File E: \software \rj \bianji \Anaconda3 \1ib \si te-packages \zmq \backend\select. py",line 28, in select_ backend
mod 
import__ (name, fromlistapublic api )
File" E: \sof tware \rj \bianji \Anaconda3 \1ib\site- packages \zmq \backend\cython_ init_ 。 py,line 6,in 
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error:找不到指定的模块。

tensorflow安装及在anaconda3 Jupyter NoteBook,pycharm环境中使用_第1张图片

用博客解决anaconda3下的jupyter notebook在命令行中无法运行问题得以解决

tensorflow在pycharm环境使用

第一个: import tensorflow as tf总是显示No module named tensorflow
解决方法:在参考了用pycharm配置好anaconda后,调用 tensorflow总是显示No module named tensorflow之后,意识到是自己项目python环境配置问题,之后对项目环境进行配置,选择File->settings
tensorflow安装及在anaconda3 Jupyter NoteBook,pycharm环境中使用_第2张图片
点击add
tensorflow安装及在anaconda3 Jupyter NoteBook,pycharm环境中使用_第3张图片
选择自己安装好的虚拟环境中的python.exe
tensorflow安装及在anaconda3 Jupyter NoteBook,pycharm环境中使用_第4张图片
环境配置好后,import tensorflow as tf 不再报错,点击运行,又遇到如下问题:
问题1、FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecate
解决方法:解决python调用TensorFlow时出现FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecate
问题2、Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
解决方法:成功解决Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

tensorflow安装及在anaconda3 Jupyter NoteBook,pycharm环境中使用_第5张图片

你可能感兴趣的:(tensorflow安装及在anaconda3 Jupyter NoteBook,pycharm环境中使用)