pytorch快速安装【清华源】

step1:安装anacoda 下载地址

bash Anaconda3-2018.12-Linux-x86_64.sh

step2:按照官网的方法安装pytorch
在这里插入图片描述

conda install pytorch torchvision cudatoolkit=10.0 -c pytorch

在此期间你会发现特别的慢,慢也就算了主要它还老安装不成功,出现的错误见我的另一篇博客

补充说明:

在用conda安装软件的过程中还会经常遇到的一个问题,就是:软件太大老是下载中断
我要下载一个软件,conda会告诉我这个软件底层依赖好几个其他的软件,需要将它们一起下载安装,这个时候这一大堆软件中可能有几个体量很大,上百MB,很容易下着下着网络连接就中断了,而conda有没有断点下载功能,一旦下载中断,conda就会终止安装进程退出运行
最后,我们转战清华源安装,运行以下命令:

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --set show_channel_urls yes
# reference
# https://mirror.tuna.tsinghua.edu.cn/help/anaconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

LAST,直接运行下面的命令就可以快速安装好啦,真的真的真的很快。。。

conda install pytorch torchvision cudatoolkit=10.0

【参考】

  1. conda软件安装的进阶操作
在 Vue3 中使用 Element Plus 的 Table 组件实现无限滚动加载功能,通常涉及到分页和懒加载的设计。以下是基本步骤: 1. **设置基础组件**:首先,在项目中引入 Element Plus 的 Table 组件,并配置基本列和数据源。 ```html <template> <el-table :data="tableData" :scroll-y="tableScrollY" @load="loadMoreData"> <!-- 表头和行内容 --> </el-table> </template> <script> import { ElTable, ElLoading } from "element-plus"; export default { components: { ElTable, ElLoading }, data() { return { tableData: [], // 初始数据 tableScrollY: { height: '400px', max: '600px' }, // 设置滚动条高度和最大值 hasMore: true, // 标记是否还有更多数据 currentPage: 1, // 当前页数 pageSize: 10, // 每页显示的数据量 }; }, methods: { loadMoreData() { if (this.hasMore) { // 模拟异步获取更多数据 this.$axios.get('/api/more-data', { params: { page: this.currentPage, size: this.pageSize } }) .then((response) => { this.tableData.push(...response.data); // 将新数据添加到现有数据数组中 this.currentPage++; // 更新当前页数 this.hasMore = response.data.length === 0; // 如果没有更多数据,则更新hasMore标志 }) .catch(() => { this.hasMore = false; }); } } }, computed: { // 使用 computed 计算总数据量以便动态计算分页 totalItems() { return this.tableData.length + (this.hasMore ? this.pageSize : 0); } }, }; </script> ``` 2. **处理滚动事件**:当用户滚动到底部时,触发 `loadMoreData` 方法加载更多的数据。 3. **优化性能**:为了提高用户体验,你可以添加一些加载指示器(如 `ElLoading`),并且在开始加载新数据之前检查是否有更多数据可用。 **
评论 94
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值