【CUDA pytorch】

ev= win10

3050ti

联想笔记本

nvcc --version

得到

复制代码
PS C:\Users\25515> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_May__3_19:00:59_Pacific_Daylight_Time_2022
Cuda compilation tools, release 11.7, V11.7.64
Build cuda_11.7.r11.7/compiler.31294372_0

CUDA版本是 11.7

复制代码
PS C:\Users\25515> wmic path win32_videocontroller get name
Name
NVIDIA GeForce RTX 3050 Ti Laptop GPU
Intel(R) Iris(R) Xe Graphics

下载torch

复制代码
https://pytorch.org/get-started/locally/

接着测试

py 复制代码
import torch

# 创建张量
x = torch.tensor([1, 2, 3])
y = torch.tensor([4, 5, 6])

# 张量加法
z = x + y
print(z)  # 输出 tensor([5, 7, 9])

# 测试 GPU 张量(如果 CUDA 可用)
if torch.cuda.is_available():
    x_gpu = x.to("cuda")
    print(x_gpu)  # 输出类似 tensor([1, 2, 3], device='cuda:0')
else:
    print("CUDA 不可用")

    pass
print(torch.__version__)

得到

有个大兄弟在卖代码,等我搓搓,哈哈

复制代码
https://gitee.com/mqwdasddqw/project-download-address

换源


项目结构

handwritten_digit_recognition/

├── a3_cnn.py # 包含 CNN 模型定义

├── model/

│ └── mnist_model.pkl # 保存的模型文件

└── main.py # 主程序文件(以下为完整代码)

hand_writing_number

相关推荐
董厂长几秒前
LLM :Function Call、MCP协议与A2A协议
网络·人工智能·深度学习·llm
Elastic 中国社区官方博客3 分钟前
Elasticsearch:我们如何在全球范围内实现支付基础设施的现代化?
大数据·人工智能·elasticsearch·搜索引擎·全文检索·可用性测试
HUIBUR科技9 分钟前
人工智能与智能合约:如何用AI优化区块链技术中的合约执行?
人工智能·ai·智能合约
当当狸1 小时前
当当狸智能天文望远镜 TW2 | 用科技触摸星辰,让探索触手可及
人工智能·科技·内容运营
LiLiYuan.1 小时前
关于Stream
java·开发语言·windows·python
geneculture1 小时前
金融的本质是智融、融资的实质是融智、投资的关键是投智,颠覆传统金融学的物质资本中心论,构建了以智力资本为核心的新范式
大数据·人工智能·算法·金融·系统工程融智学
Green1Leaves1 小时前
从零开始学习人工智能(Python高级教程)Day6-Python3 正则表达式
python·学习·正则表达式
码有余悸1 小时前
初学Python爬虫
python
极小狐1 小时前
极狐Gitlab 如何创建并使用子群组?
数据库·人工智能·git·机器学习·gitlab
派阿喵搞电子2 小时前
YOLOv8的Python基础--函数篇
python·yolov8