Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 PYTHON - starting the AI engine, anyone interested?

views
     
TSplumberly
post Aug 3 2023, 05:06 PM, updated 2y ago

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


Struggling for the past week or so trying to set up MSVS, Cuda, CuDNN, etc. to use the Cuda cores in my 4070 GPU via tensorflow. The aim is to speed up the machine learning trials.

Did the A to Z installation twice, uninstalled all, and started from fresh. Got FALSE at the end twice when checking to see if the installations were successful. Watched many videos on the installation and still had no luck. Many users also suffered this unpleasant FALSE anti-climax at the end. Ha. Yes, I am confident that I used the correct cuba, cudnn, etc. versions and yet failed the installation.

Disappointed and frustrated. But all is not lost as I just realised that I can still use the Cuda cores via Cupy, Numba, etc. Only Tensorflow is giving me the problem. I think I will leave the tensorflow cuda problem in the dark corner now and revisit it in the coming months.

Like to know if there are friends here with similar interests who can lend a hand to those in trouble (installation, Python programming, ML, DL, etc.)

Cheerio.



AthrunIJ
post Aug 3 2023, 05:10 PM

Look at all my stars!!
*******
Senior Member
2,992 posts

Joined: Feb 2015

Not very familiar with tf.

For pytorch, basically can just straight pip install it with cuda drivers straight.

Then use docker to set up jupyter with cuda drivers straight.

Maybe can check the tf github if there is already a precompiled version with cuda.

This post has been edited by AthrunIJ: Aug 3 2023, 05:11 PM
TSplumberly
post Aug 3 2023, 06:58 PM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


QUOTE(AthrunIJ @ Aug 3 2023, 05:10 PM)
Not very familiar with tf.

For pytorch, basically can just straight pip install it with cuda drivers straight.

Then use docker to set up jupyter with cuda drivers straight.

Maybe can check the tf github if there is already a precompiled version with cuda.
*
Noted and thanks.

Not using Jupyter. Started using MSVS IDE, didnt like it, tried Anaconda and liked Spyder. But later moved to Pycharm (community) and I think I will stay put.

Did you mean precompiled cuda - tensorflow? That will be nice!

Cheerio.

sasuketaichou
post Aug 3 2023, 07:00 PM

Getting Started
**
Junior Member
192 posts

Joined: Jun 2013
Ive got some experienced in setting up environment for machine learning. What are you trying to do?
AthrunIJ
post Aug 3 2023, 07:02 PM

Look at all my stars!!
*******
Senior Member
2,992 posts

Joined: Feb 2015

QUOTE(plumberly @ Aug 3 2023, 06:58 PM)
Noted and thanks.

Not using Jupyter. Started using MSVS IDE, didnt like it, tried Anaconda and liked Spyder. But later moved to Pycharm (community) and I think I will stay put.

Did you mean precompiled cuda - tensorflow? That will be nice!

Cheerio.
*
There should be a precompiled cuda for tf for python as Python is designed for ease of used.

Can look around.

If not then need to compile by your ownself I guess.

This post has been edited by AthrunIJ: Aug 3 2023, 07:05 PM
TSplumberly
post Aug 4 2023, 08:43 AM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


QUOTE(sasuketaichou @ Aug 3 2023, 07:00 PM)
Ive got some experienced in setting up environment for machine learning. What are you trying to do?
*
Good. Mind sharing which system, Python? Your ML to do what?

I am interested in number crunching to reveal what the numbers are telling.

Correct to say cupy is better than tensorflow for number crunching?
TSplumberly
post Aug 4 2023, 08:46 AM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


QUOTE(AthrunIJ @ Aug 3 2023, 07:02 PM)
There should be a precompiled cuda for tf for python as Python is designed for ease of used.

Can look around.

If not then need to compile by your ownself I guess.
*
Thanks.

I dont think there is one. Otherwise, me and many other users will not be trying to install cuda tensorflow which is rather tricky to get it right.

Interested to know more about the "compile yourself" route. Any link I can study?

AthrunIJ
post Aug 4 2023, 09:10 AM

Look at all my stars!!
*******
Senior Member
2,992 posts

Joined: Feb 2015

QUOTE(plumberly @ Aug 4 2023, 08:46 AM)
Thanks.

I dont think there is one. Otherwise, me and many other users will not be trying to install cuda tensorflow which is rather tricky to get it right.

Interested to know more about the "compile yourself" route. Any link I can study?
*
Pretty much need to follow the tf install documentation.

https://www.tensorflow.org/install/source
TSplumberly
post Aug 4 2023, 09:44 AM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


QUOTE(AthrunIJ @ Aug 4 2023, 09:10 AM)
Pretty much need to follow the tf install documentation.

https://www.tensorflow.org/install/source
*
Thanks. That is the one I have been following with youtube videos.

Found another video today that does not need MSVS Cuda Cudnn steps. Simpler and I will give it a try later.

AthrunIJ
post Aug 4 2023, 10:09 AM

Look at all my stars!!
*******
Senior Member
2,992 posts

Joined: Feb 2015

QUOTE(plumberly @ Aug 4 2023, 09:44 AM)
Thanks. That is the one I have been following with youtube videos.

Found another video today that does not need MSVS Cuda Cudnn steps. Simpler and I will give it a try later.
*
I see.

All the best and have fun


TSplumberly
post Aug 4 2023, 08:20 PM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


Glad to report that now TensorFlow can access cuda cores on my GPU. Finally. Did it via the video below. Simpler than the old method of installing MSVS, Cuda, CuDNN etc. matching the different app versions.

https://www.youtube.com/watch?v=0S81koZpwPA

But facing another problem. My Python in Pycharm cannot access the Cuda. Found out that only Pycharm Pro has WSL support. Using community version. So no WSL access in my Pycharm.

Plan to uninstall the MSVS (29 GB!) As WSL has Linux with C compiler, I guess there is no need now for MSVS for its C compiler. Can sifu here confirm that? Dont want to dig a big hole if I uninstalled it on the wrong assumption.

Thanks.

MatQuasar
post Aug 4 2023, 09:16 PM

Casual
***
Validating
329 posts

Joined: Jun 2023
Visual Studio is C++, not C, I am not too sure because I mainly use VS for C#.

TSplumberly
post Aug 5 2023, 09:18 AM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


QUOTE(MatQuasar @ Aug 4 2023, 09:16 PM)
Visual Studio is C++, not C, I am not too sure because I mainly use VS for C#.
*
Thanks. Learned something new today.

MSVS has Microsoft Visual C++ and this can compile C, C++, C++/CLI and C++/CX.

I used to use MSVS for VBasic.
TSplumberly
post Aug 6 2023, 12:25 PM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


QUOTE(AthrunIJ @ Aug 3 2023, 05:10 PM)
Not very familiar with tf.

For pytorch, basically can just straight pip install it with cuda drivers straight.

Then use docker to set up jupyter with cuda drivers straight.

Maybe can check the tf github if there is already a precompiled version with cuda.
*
Since you mentioned pytorch and I am having a problem using tensorflow-GPU in Pycharm (WSL2 not supported in the community version), did a quick study today.

Thought tensorflow was the sifu until I saw this ...

Attached Image

The Pytorch & Cuda installation is much easier than tensorflow.

pip uninstall torch torchvision
pip install torch torchvision -f https://download.pytorch.org/whl/cuXXX/torch_stable.html

XXX is your installed CUDA version.

Happy to report the higher speed in pytorch-cuda than numpy.

Time taken for NumPy matrix multiplication: 411.7928 seconds
Time taken for PyTorch matrix multiplication: 22.4806 seconds

rclxms.gif rclxms.gif rclxm9.gif rclxm9.gif thumbup.gif thumbup.gif thumbsup.gif thumbsup.gif whistling.gif whistling.gif
AthrunIJ
post Aug 6 2023, 12:38 PM

Look at all my stars!!
*******
Senior Member
2,992 posts

Joined: Feb 2015

QUOTE(plumberly @ Aug 6 2023, 12:25 PM)
Since you mentioned pytorch and I am having a problem using tensorflow-GPU in Pycharm (WSL2 not supported in the community version), did a quick study today.

Thought tensorflow was the sifu until I saw this ...

Attached Image

The Pytorch & Cuda installation is much easier than tensorflow.

pip uninstall torch torchvision
pip install torch torchvision -f https://download.pytorch.org/whl/cuXXX/torch_stable.html

XXX is your installed CUDA version.

Happy to report the higher speed in pytorch-cuda than numpy.

Time taken for NumPy matrix multiplication: 411.7928 seconds
Time taken for PyTorch matrix multiplication: 22.4806 seconds

rclxms.gif  rclxms.gif  rclxm9.gif  rclxm9.gif  thumbup.gif  thumbup.gif  :thumbsup:  :thumbsup:  whistling.gif  whistling.gif
*
Haha

Yea, enjoy.

Pytorch will be getting better with the open source community.
TSplumberly
post Aug 6 2023, 02:01 PM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


Just in case you want to know, how does cupy compare to pytorch in speed, did a quick test.

Results on the 2nd run (1st run is not true due to the time taken to transfer the data to the GPU, 2nd run the data is already in the GPU),

cupy 1.45 sec
pytorch cuda 1.60 sec

About the same. But pytorch is better in terms of the whole stack build from pre data processing to roll out, I think.
TSplumberly
post Aug 16 2023, 02:33 PM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


Trying to learn LSTM for forecasting. As opaque as kopi kau. Ha. Any friend here can help this dummy? Interested in multivariate LSTM. Have watched a few videos and slowly slowly getting there.

Read that transformers are better than LSTM for both the short and long term memory. Any example to share?

Cheerio.
TSplumberly
post Jul 8 2024, 01:32 PM

Look at all my stars!!
*******
Senior Member
4,761 posts

Joined: Jun 2007
From: My house


Sharing this web, especially for those also in the hunt for the Pytorch and Cuda versions.

https://dev-discuss.pytorch.org/t/pytorch-r...-available/2213

 

Change to:
| Lo-Fi Version
0.0340sec    0.52    6 queries    GZIP Disabled
Time is now: 17th December 2025 - 03:05 AM