TensorFlow Installation Guide for the Windows 10 Environment

TensorFlow Installation Guide for the Windows 10 Environment

  1. Windows10 OS environment should be UpToDate
  2. To install the TensorFlow then need to follow below steps

C:\Users\balaj>pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in c:\program files\python310\lib\site-packages (22.0.4)
Collecting pip
  Downloading pip-24.0-py3-none-any.whl (2.1 MB)
     ---------------------------------------- 2.1/2.1 MB 4.5 MB/s eta 0:00:00
Installing collected packages: pip
  WARNING: The scripts pip.exe, pip3.10.exe and pip3.exe are installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-24.0
WARNING: You are using pip version 22.0.4; however, version 24.0 is available.
You should consider upgrading via the 'C:\Program Files\Python310\python.exe -m pip install --upgrade pip' command.        

3. Install tensorflow use the below command

C:\Users\balaj>pip install tensorflow
Defaulting to user installation because normal site-packages is not writeable
Collecting tensorflow
  Downloading tensorflow-2.16.1-cp310-cp310-win_amd64.whl.metadata (3.5 kB)
Collecting tensorflow-intel==2.16.1 (from tensorflow)
  Downloading tensorflow_intel-2.16.1-cp310-cp310-win_amd64.whl.metadata (5.0 kB)
Collecting absl-py>=1.0.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading absl_py-2.1.0-py3-none-any.whl.metadata (2.3 kB)
Collecting astunparse>=1.6.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading astunparse-1.6.3-py2.py3-none-any.whl.metadata (4.4 kB)
Collecting flatbuffers>=23.5.26 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading flatbuffers-24.3.7-py2.py3-none-any.whl.metadata (849 bytes)
Collecting gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading gast-0.5.4-py3-none-any.whl.metadata (1.3 kB)
Collecting google-pasta>=0.1.1 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading google_pasta-0.2.0-py3-none-any.whl.metadata (814 bytes)
Collecting h5py>=3.10.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading h5py-3.10.0-cp310-cp310-win_amd64.whl.metadata (2.5 kB)
Collecting libclang>=13.0.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading libclang-16.0.6-py2.py3-none-win_amd64.whl.metadata (5.3 kB)
Collecting ml-dtypes~=0.3.1 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading ml_dtypes-0.3.2-cp310-cp310-win_amd64.whl.metadata (20 kB)
Collecting opt-einsum>=2.3.2 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading opt_einsum-3.3.0-py3-none-any.whl.metadata (6.5 kB)
Collecting packaging (from tensorflow-intel==2.16.1->tensorflow)
  Downloading packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
Collecting protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading protobuf-4.25.3-cp310-abi3-win_amd64.whl.metadata (541 bytes)
Requirement already satisfied: requests<3,>=2.21.0 in c:\users\balaj\appdata\roaming\python\python310\site-packages (from tensorflow-intel==2.16.1->tensorflow) (2.31.0)
Requirement already satisfied: setuptools in c:\program files\python310\lib\site-packages (from tensorflow-intel==2.16.1->tensorflow) (58.1.0)
Collecting six>=1.12.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting termcolor>=1.1.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading termcolor-2.4.0-py3-none-any.whl.metadata (6.1 kB)
Requirement already satisfied: typing-extensions>=3.6.6 in c:\users\balaj\appdata\roaming\python\python310\site-packages (from tensorflow-intel==2.16.1->tensorflow) (4.9.0)
Collecting wrapt>=1.11.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading wrapt-1.16.0-cp310-cp310-win_amd64.whl.metadata (6.8 kB)
Collecting grpcio<2.0,>=1.24.3 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading grpcio-1.62.1-cp310-cp310-win_amd64.whl.metadata (4.2 kB)
Collecting tensorboard<2.17,>=2.16 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading tensorboard-2.16.2-py3-none-any.whl.metadata (1.6 kB)
Collecting keras>=3.0.0 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading keras-3.0.5-py3-none-any.whl.metadata (4.8 kB)
Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading tensorflow_io_gcs_filesystem-0.31.0-cp310-cp310-win_amd64.whl.metadata (14 kB)
Collecting numpy<2.0.0,>=1.23.5 (from tensorflow-intel==2.16.1->tensorflow)
  Downloading numpy-1.26.4-cp310-cp310-win_amd64.whl.metadata (61 kB)
     ---------------------------------------- 61.0/61.0 kB 3.2 MB/s eta 0:00:00
Collecting wheel<1.0,>=0.23.0 (from astunparse>=1.6.0->tensorflow-intel==2.16.1->tensorflow)
  Downloading wheel-0.43.0-py3-none-any.whl.metadata (2.2 kB)
Collecting rich (from keras>=3.0.0->tensorflow-intel==2.16.1->tensorflow)
  Downloading rich-13.7.1-py3-none-any.whl.metadata (18 kB)
Collecting namex (from keras>=3.0.0->tensorflow-intel==2.16.1->tensorflow)
  Downloading namex-0.0.7-py3-none-any.whl.metadata (246 bytes)
Collecting dm-tree (from keras>=3.0.0->tensorflow-intel==2.16.1->tensorflow)
  Downloading dm_tree-0.1.8-cp310-cp310-win_amd64.whl.metadata (2.0 kB)
Requirement already satisfied: charset-normalizer<4,>=2 in c:\users\balaj\appdata\roaming\python\python310\site-packages (from requests<3,>=2.21.0->tensorflow-intel==2.16.1->tensorflow) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in c:\users\balaj\appdata\roaming\python\python310\site-packages (from requests<3,>=2.21.0->tensorflow-intel==2.16.1->tensorflow) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in c:\users\balaj\appdata\roaming\python\python310\site-packages (from requests<3,>=2.21.0->tensorflow-intel==2.16.1->tensorflow) (2.2.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\balaj\appdata\roaming\python\python310\site-packages (from requests<3,>=2.21.0->tensorflow-intel==2.16.1->tensorflow) (2024.2.2)
Collecting markdown>=2.6.8 (from tensorboard<2.17,>=2.16->tensorflow-intel==2.16.1->tensorflow)
  Downloading Markdown-3.5.2-py3-none-any.whl.metadata (7.0 kB)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard<2.17,>=2.16->tensorflow-intel==2.16.1->tensorflow)
  Downloading tensorboard_data_server-0.7.2-py3-none-any.whl.metadata (1.1 kB)
Collecting werkzeug>=1.0.1 (from tensorboard<2.17,>=2.16->tensorflow-intel==2.16.1->tensorflow)
  Downloading werkzeug-3.0.1-py3-none-any.whl.metadata (4.1 kB)
Collecting MarkupSafe>=2.1.1 (from werkzeug>=1.0.1->tensorboard<2.17,>=2.16->tensorflow-intel==2.16.1->tensorflow)
  Downloading MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl.metadata (3.1 kB)
Collecting markdown-it-py>=2.2.0 (from rich->keras>=3.0.0->tensorflow-intel==2.16.1->tensorflow)
  Downloading markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pygments<3.0.0,>=2.13.0 (from rich->keras>=3.0.0->tensorflow-intel==2.16.1->tensorflow)
  Downloading pygments-2.17.2-py3-none-any.whl.metadata (2.6 kB)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich->keras>=3.0.0->tensorflow-intel==2.16.1->tensorflow)
  Downloading mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Downloading tensorflow-2.16.1-cp310-cp310-win_amd64.whl (2.1 kB)
Downloading tensorflow_intel-2.16.1-cp310-cp310-win_amd64.whl (376.9 MB)
   ---------------------------------------- 376.9/376.9 MB 3.8 MB/s eta 0:00:00
Downloading absl_py-2.1.0-py3-none-any.whl (133 kB)
   ---------------------------------------- 133.7/133.7 kB 4.0 MB/s eta 0:00:00
Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Downloading flatbuffers-24.3.7-py2.py3-none-any.whl (26 kB)
Downloading gast-0.5.4-py3-none-any.whl (19 kB)
Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB)
   ---------------------------------------- 57.5/57.5 kB 3.0 MB/s eta 0:00:00
Downloading grpcio-1.62.1-cp310-cp310-win_amd64.whl (3.8 MB)
   ---------------------------------------- 3.8/3.8 MB 6.2 MB/s eta 0:00:00
Downloading h5py-3.10.0-cp310-cp310-win_amd64.whl (2.7 MB)
   ---------------------------------------- 2.7/2.7 MB 6.4 MB/s eta 0:00:00
Downloading keras-3.0.5-py3-none-any.whl (1.0 MB)
   ---------------------------------------- 1.0/1.0 MB 7.2 MB/s eta 0:00:00
Downloading libclang-16.0.6-py2.py3-none-win_amd64.whl (24.4 MB)
   ---------------------------------------- 24.4/24.4 MB 6.4 MB/s eta 0:00:00
Downloading ml_dtypes-0.3.2-cp310-cp310-win_amd64.whl (127 kB)
   ---------------------------------------- 127.8/127.8 kB 2.6 MB/s eta 0:00:00
Downloading numpy-1.26.4-cp310-cp310-win_amd64.whl (15.8 MB)
   ---------------------------------------- 15.8/15.8 MB 5.8 MB/s eta 0:00:00
Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB)
   ---------------------------------------- 65.5/65.5 kB 1.8 MB/s eta 0:00:00
Downloading protobuf-4.25.3-cp310-abi3-win_amd64.whl (413 kB)
   ---------------------------------------- 413.4/413.4 kB 5.2 MB/s eta 0:00:00
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Downloading tensorboard-2.16.2-py3-none-any.whl (5.5 MB)
   ---------------------------------------- 5.5/5.5 MB 6.5 MB/s eta 0:00:00
Downloading tensorflow_io_gcs_filesystem-0.31.0-cp310-cp310-win_amd64.whl (1.5 MB)
   ---------------------------------------- 1.5/1.5 MB 5.9 MB/s eta 0:00:00
Downloading termcolor-2.4.0-py3-none-any.whl (7.7 kB)
Downloading wrapt-1.16.0-cp310-cp310-win_amd64.whl (37 kB)
Downloading packaging-24.0-py3-none-any.whl (53 kB)
   ---------------------------------------- 53.5/53.5 kB 2.9 MB/s eta 0:00:00
Downloading Markdown-3.5.2-py3-none-any.whl (103 kB)
   ---------------------------------------- 103.9/103.9 kB 5.9 MB/s eta 0:00:00
Downloading tensorboard_data_server-0.7.2-py3-none-any.whl (2.4 kB)
Downloading werkzeug-3.0.1-py3-none-any.whl (226 kB)
   ---------------------------------------- 226.7/226.7 kB 7.0 MB/s eta 0:00:00
Downloading wheel-0.43.0-py3-none-any.whl (65 kB)
   ---------------------------------------- 65.8/65.8 kB 3.5 MB/s eta 0:00:00
Downloading dm_tree-0.1.8-cp310-cp310-win_amd64.whl (101 kB)
   ---------------------------------------- 101.3/101.3 kB 5.7 MB/s eta 0:00:00
Downloading namex-0.0.7-py3-none-any.whl (5.8 kB)
Downloading rich-13.7.1-py3-none-any.whl (240 kB)
   ---------------------------------------- 240.7/240.7 kB 4.9 MB/s eta 0:00:00
Downloading markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
   ---------------------------------------- 87.5/87.5 kB 4.8 MB/s eta 0:00:00
Downloading MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl (17 kB)
Downloading pygments-2.17.2-py3-none-any.whl (1.2 MB)
   ---------------------------------------- 1.2/1.2 MB 7.5 MB/s eta 0:00:00
Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: namex, libclang, flatbuffers, dm-tree, wrapt, wheel, termcolor, tensorflow-io-gcs-filesystem, tensorboard-data-server, six, pygments, protobuf, packaging, numpy, mdurl, MarkupSafe, markdown, grpcio, gast, absl-py, werkzeug, opt-einsum, ml-dtypes, markdown-it-py, h5py, google-pasta, astunparse, tensorboard, rich, keras, tensorflow-intel, tensorflow
  WARNING: The script wheel.exe is installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script pygmentize.exe is installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script f2py.exe is installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script markdown_py.exe is installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script markdown-it.exe is installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script tensorboard.exe is installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts import_pb_to_tensorboard.exe, saved_model_cli.exe, tensorboard.exe, tf_upgrade_v2.exe, tflite_convert.exe, toco.exe and toco_from_protos.exe are installed in 'C:\Users\balaj\AppData\Roaming\Python\Python310\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed MarkupSafe-2.1.5 absl-py-2.1.0 astunparse-1.6.3 dm-tree-0.1.8 flatbuffers-24.3.7 gast-0.5.4 google-pasta-0.2.0 grpcio-1.62.1 h5py-3.10.0 keras-3.0.5 libclang-16.0.6 markdown-3.5.2 markdown-it-py-3.0.0 mdurl-0.1.2 ml-dtypes-0.3.2 namex-0.0.7 numpy-1.26.4 opt-einsum-3.3.0 packaging-24.0 protobuf-4.25.3 pygments-2.17.2 rich-13.7.1 six-1.16.0 tensorboard-2.16.2 tensorboard-data-server-0.7.2 tensorflow-2.16.1 tensorflow-intel-2.16.1 tensorflow-io-gcs-filesystem-0.31.0 termcolor-2.4.0 werkzeug-3.0.1 wheel-0.43.0 wrapt-1.16.0        

4. Verify the CPU Setup

C:\Users\balaj>"C:\Program Files\Python310\python.exe" -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
2024-03-14 08:13:12.991586: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-03-14 08:13:14.974052: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2024-03-14 08:13:18.942813: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
tf.Tensor(-84.783875, shape=(), dtype=float32)

C:\Users\balaj>set TF_ENABLE_ONEDNN_OPTS=0

C:\Users\balaj>"C:\Program Files\Python310\python.exe" -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
2024-03-14 08:13:51.246712: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
tf.Tensor(87.52957, shape=(), dtype=float32)        

5. Verify whether the tensorflow is installed and check the version

C:\Users\balaj>pip show tensorflow
Name: tensorflow
Version: 2.16.1
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: c:\users\balaj\appdata\roaming\python\python310\site-packages
Requires: tensorflow-intel
Required-by:        




要查看或添加评论,请登录

Balaji Bharath Mandava的更多文章

社区洞察

其他会员也浏览了