Run tensorflow and keras perfectly on jupyter notebook

Use TensorFlow in jupyter toInstall ipython and jupyter after activating TensorFlow
For the installation of Tensorflow, please refer to the tensorflow configuration method in the win10+python3.6+tensorflow-cpu+keras+Pycharm environment posted earlier

Connect tensorflow configuration method under win10+python3.6+tensorflow-cpu+keras+Pycharm environment

(tensorflow) C:\Users\Administrator>python
Python 3.6.11  [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras
Using TensorFlow backend.
>>>quit()

(tensorflow) C:\Users\Administrator>

After installing and testing keras, use quit() to exit the python code editing. In the tensorflow environment, enter the following command:

conda install ipython

(tensorflow) C:\Users\Administrator>conda install ipython

conda install jupyter

(tensorflow) C:\Users\Administrator>conda install jupyter

ipython kernelspec install-self --user
needs attention hereThere are two in front of user –

(tensorflow) C:\Users\Administrator>ipython kernelspec install-self --user
[TerminalIPythonApp] WARNING | Subcommand `ipython kernelspec` is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter kernelspec` in the future
[InstallNativeKernelSpec] WARNING | `jupyter kernelspec install-self` is DEPRECATED as of 4.0. You probably want `ipython kernel install` to install the IPython kernelspec.
[InstallNativeKernelSpec] Installed kernelspec python3 in C:\Users\Administrator\AppData\Roaming\jupyter\kernels\python3

Open Jupyter notebook and run

import tensorflow as tf
import keras

Insert picture description here

No error, it means success!!!

Refer to
using anaconda to install tensorflow and use it in Jupyter Notebook

Guess you like

Origin blog.csdn.net/weixin_45656790/article/details/108931267