technical:recipes:tensorflow-in-virtualenv

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
technical:recipes:tensorflow-in-virtualenv [2025-10-28 16:01] – [Create TensorFlow Virtualenv] thuachentechnical:recipes:tensorflow-in-virtualenv [2025-11-06 15:30] (current) – [Create TensorFlow Virtualenv] thuachen
Line 40: Line 40:
 tensorflow                    2.19.0 cpu_py312h69ecde4_53  conda-forge tensorflow                    2.19.0 cpu_py312h69ecde4_53  conda-forge
 </code> </code>
-All versions of the TensorFlow virtual environment will be stored in the directory ''$WORKDIR/sw/tensorflow''; each virtual environment must have a unique name that will become the VALET version of TensorFlow. In this tutorial, we will install the Tensorflow version 2.17.0 with and without the CUDA support. An appropriate version for the former would be ''2.17.0:cpu'' and the latter ''2.17.0:cuda'' Those versions can be translated to VALET-friendly directory names:+All versions of the TensorFlow virtual environment will be stored in the directory ''$WORKDIR/sw/tensorflow''; each virtual environment must have a unique name that will become the VALET version of TensorFlow. In this tutorial, we will install the Tensorflow version 2.17.0 with the CPU support and with CUDA support. An appropriate version for the former would be ''2.17.0:cpu'' and the latter ''2.17.0:cuda'' Those versions can be translated to VALET-friendly directory names:
  
 <code bash> <code bash>
Line 100: Line 100:
 <code bash> <code bash>
 [(my_workgroup:user)@login01 ~]$ conda activate /work/workgroup/sw/tensorflow/2.17.0-cuda [(my_workgroup:user)@login01 ~]$ conda activate /work/workgroup/sw/tensorflow/2.17.0-cuda
-[(my_workgroup:user)@login01 ~]$ pip install "tensorflow[and-cuda]==2.17.0"+(/work/workgroup/sw/tensorflow/2.17.0-cuda)[(my_workgroup:user)@login01 ~]$ pip install "tensorflow[and-cuda]==2.17.0"
 </code> </code>
-Ignore that ''conda activate'' command as well. Roll back the environment changes before proceeding:+Use ''conda deactivate'' command to exit the virtual environment. Roll back the environment changes before proceeding:
  
 <code bash> <code bash>
-[(my_workgroup:user)@login01 ~]$ vpkg_rollback +(/work/workgroup/sw/tensorflow/2.17.0-cuda)[(my_workgroup:user)@login01 ~]$ conda deactivate 
-[(my_workgroup:user)@login01 ~]$ +[(my_workgroup:user)@login01 ~]$ vpkg_rollback all
 </code> </code>
  
Line 127: Line 127:
           success: 0           success: 0
     versions:     versions:
-        "2.19.0:cpu": +        "2.17.0:cpu": 
-            description: 2.19.0 with CPU support+            description: 2.17.0 with CPU support
             dependencies:             dependencies:
                 - miniconda/25.1.1.2                 - miniconda/25.1.1.2
-        "2.19.0:cuda": +        "2.17.0:cuda": 
-            description: 2.19.0 with CUDA support+            description: 2.17.0 with CUDA support
             dependencies:             dependencies:
                 - miniconda/25.1.1.2                 - miniconda/25.1.1.2
Line 152: Line 152:
           success: 0           success: 0
     versions:     versions:
-        "2.19.0:cpu": +        "2.17.0:cpu": 
-            description: 2.19.0 with CPU support+            description: 2.17.0 with CPU support
             dependencies:             dependencies:
                 - miniconda/25.1.1.2                 - miniconda/25.1.1.2
-        "2.19.0:cuda": +        "2.17.0:cuda": 
-            description: 2.19.0 with CUDA support+            description: 2.17.0 with CUDA support
             dependencies:             dependencies:
                 - miniconda/25.1.1.2                 - miniconda/25.1.1.2
Line 179: Line 179:
 [/work/my_workgroup/sw/valet/tensorflow.vpkg_yaml] [/work/my_workgroup/sw/valet/tensorflow.vpkg_yaml]
 tensorflow               TensorFlow Python environments tensorflow               TensorFlow Python environments
-* 2.19.0:cpu              2.19.0 with GPU support +* 2.17.0:cpu              2.17.0 with GPU support 
-  2.19.0:cuda             2.19.0 with CUDA support+  2.17.0:cuda             2.17.0 with CUDA support
      
      :      :
Line 193: Line 193:
 # Setup TensorFlow virtualenv: # Setup TensorFlow virtualenv:
 # #
-vpkg_require tensorflow/2.19.0:cpu+vpkg_require tensorflow/2.17.0:cpu
  
 # #
  • technical/recipes/tensorflow-in-virtualenv.1761681706.txt.gz
  • Last modified: 2025-10-28 16:01
  • by thuachen