Langsung ke konten utama

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

Prof Ashari, Tangan Dingin Sang Rektor Visioner

Tulisan ini dipersembahkan kepada Prof  Dr Ir. Mochamad Ashari, M.Eng, IPU,  AEng. yang merupakan rektor ke-12 ITS, periode 2019-2024. Seluruh tulisan ini berupa pandangan saya pribadi, sebagai ucapan terima kasih, meski disajikan seakan penuh kritikan pada bagian awalnya. Pertama saya mengenal nama ini, saya ingat dari salah satu dosen saya sewaktu saya masih menempuh sarjana. Saya lupa persis kapan, tetapi saya diperkenalkan tentang bagaimana visionernya Prof Ashari dan sedikit cuplikan peran beliau membangun Telkom University di Bandung. Ya, sebelum beliau dinobatkan sebagai rektor, saya berpikir bahwa 'apabila beliau jadi, sepertinya akan berpotensi revolusioner, atau bakal agak ekstrem dalam kebijakan'. Bagi saya, itu cukup menarik, tetapi ada ketakutan di benak saya dengan potensi ekstrem kebijakan beliau. Kala beliau dinobatkan sebagai rektor terpilih, Prof Ashari langsung bergerak cepat yang tidak membutuhkan waktu lama untuk melihat langkah beliau. Saya masih ingat, d...

Sometimes, Calmest Moves Sets Brightest Flames

What sets into this massive burning, was a fragile calm plan that was overlooked by the opposition. Hi, this is Daffa from server 1194. As of this writing, I am T2W member and one of the R4 responsible for banner handling, which I am doing a terrible job of, or so I would say of myself. On one Saturday, 23th of June 2024, T2W command decided that we will set WVL to their destruction, officially due to them being a hindrance to our facility interest. The assigned task for me is clear: establish a path to their facility with banners from our old headquarters within a few tens of miles from them. Operation starts in the morning of my time zone. A total of 5 banners was done by noon due to some resource complications. I am under impression that WVL would have some idea of what we are doing with a fast approaching banner, but our intelligence inside WVL suggests otherwise. The reports shown that they consider us "have been quiet today" after some raids the previous day that I sta...