Preparing Anaconda with Tensorflow [ACTUALLY WORKED FOR ME 2024]

Make sure to follow this with perfect order:

1. conda create -n tf_gpu tensorflow-gpu

2. conda activate tf_gpu

3. pip install numpy==1.23.4

[EXECUTE GPU TEST CODE] ==> CODE MUST RETURN GPU NUMBER > 0 [#CONFIRMED]

4. pip install tensorflow-gpu==2.10

[EXECUTE GPU TEST CODE] ==> CODE MUST RETURN GPU NUMBER > 0 [#CONFIRMED]

5. pip install tensorflow==2.10

[EXECUTE GPU TEST CODE] ==> CODE MUST RETURN GPU NUMBER > 0 [#CONFIRMED]

(You may skip the first two test, but it helps ensure your environment is set up right)

 

TRIVIA:

- There's no 2.11 version of Tensorflow GPU on pip as shown below:

ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==2.11 (from versions: 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.6.0, 2.6.1, 2.6.2, 2.6.3, 2.6.4, 2.6.5, 2.7.0rc0, 2.7.0rc1, 2.7.0, 2.7.1, 2.7.2, 2.7.3, 2.7.4, 2.8.0rc0, 2.8.0rc1, 2.8.0, 2.8.1, 2.8.2, 2.8.3, 2.8.4, 2.9.0rc0, 2.9.0rc1, 2.9.0rc2, 2.9.0, 2.9.1, 2.9.2, 2.9.3, 2.10.0rc0, 2.10.0rc1, 2.10.0rc2, 2.10.0rc3, 2.10.0, 2.10.1, 2.12.0)
ERROR: No matching distribution found for tensorflow-gpu==2.11 

- I suspect for Tensorflow > 2.10 should be doable without the tensorflow-gpu since according to TF, 2.11 onward has GPU support integrated but am too tired to test at 1AM

- Some other tutorials might suggest you to install keras, but remember that the initial package from conda already has keras inside

- Available Tensorflow on pip:

Available versions: 2.18.0, 2.17.1, 2.17.0, 2.16.2, 2.16.1, 2.15.1, 2.15.0, 2.14.1, 2.14.0, 2.13.1, 2.13.0, 2.12.1, 2.12.0, 2.11.1, 2.11.0, 2.10.1, 2.10.0, 2.9.3, 2.9.2, 2.9.1, 2.9.0, 2.8.4, 2.8.3, 2.8.2, 2.8.1, 2.8.0, 2.7.4, 2.7.3, 2.7.2, 2.7.1, 2.7.0, 2.6.5, 2.6.4, 2.6.3, 2.6.2, 2.6.1, 2.6.0, 2.5.3, 2.5.2, 2.5.1, 2.5.0


CODE AND FILES:

[1] GPU TEST CODE

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

[2] MNIST Test from acsu.buffalo.edu

 

If you feel this has been a very helpful quick guide, don't forget to recommend this post to your friends also struggling with this nonsense! Also, you can tip me here!

Komentar

Postingan populer dari blog ini

[HOAX] Pesan Juru Kunci

Daftar Enzim Pencernaan, Letak dan Fungsi

Typeform : Membuat Formulir dengan Mudah!