Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the long loading time of cuda () in python

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail the solution that takes a long time to load cuda () in python. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Method 1: pip install-upgrade-force-reinstall http://download.pytorch.org/whl/cu80/torch-0.2.0.post3-cp27-cp27mu-manylinux1_x86_64.whl

After this, you can find your own installation packages for python and cuda versions on the official website. The official website is a link:

Method 2: conda install pytorch torchvision cuda80-c soumith

Here you can determine according to your own version of cuda. Check the cuda version and type in the python command line:

Import torchtorch.version.cuda

That's it.

Add: about the reasons for the failure of calling cuda () using torch in win10 environment

After reading countless blogs, they were all wrong, and it took a long time to figure it out.

If you see such an error in the process of using torch, it is not your problem, nor is it the code. It's win10.

You just need to add in front of the code

Torch.cuda.current_device () torch.cuda._initialized = True

You can train normally.

On the "python cuda () load long solution" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report