Anaconda+tensorflow installation complete steps [pro-test available]

anaconda install tensorflow

1. Install anaconda

Download anaconda from the official website ( https://www.anaconda.com/products/distribution )
insert image description here

2. Download the windows version to download and install

insert image description here

3. Open Anaconda Prompt

insert image description here
(1) Check whether the anaconda environment is installed successfully

conda --version

insert image description here
(2) Detect which environment variables are currently installed:

conda info –-envs

insert image description here
(3) Install a supporting python in anaconda and create a tensorflow environment

conda create -n TF2 python==3.9

(TF2 is named by itself)
and then enter y
insert image description here

4. Install tensorflow

(1) Use the activate TF2 (same name as the environment you just created) command to open the newly created tensorflow environment

activate TF2

If you exit the tensorflow environment:

deactivate

(2) Input command

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

insert image description here
insert image description here
5. Test

python
import tensorflow as tf
tf.__version__

insert image description here

PyCharm download and installation

1. Download the pycharm community version from the official website

pycharm windows version download address: https://www.jetbrains.com/pycharm/download/#section=windows
insert image description here

2. PyCharm environment configuration

insert image description here
insert image description here

3. Test

import tensorflow as tf

tensorflow_version = tf.__version__
gpu_avilable = tf.test.is_gpu_available()

print("tensorflow version: ", tensorflow_version,"\tGPU aviable:", gpu_avilable)

a = tf.constant([1.0,2.0], name = 'a')
b = tf.constant([1.0,2.0], name = 'b')
result = tf.add(a,b,name='add')
print(result)

Result:
insert image description here
insert image description here
If tensorflow is not successfully installed in acanoda, install it in pycharm.
Click on File-settings
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/fyfy96/article/details/128155222