摘要: import torch import numpy as np a = np.array([1, 2, 3]) t = torch.as_tensor(a) print(t) t[0] = -1 a 将numpy转为tensor也可以使用t = torch.from_numpy(a) 阅读全文
posted @ 2022-03-18 18:53 Tomorrow1126 阅读(305) 评论(0) 推荐(0) 编辑
摘要: Python replace() 方法把字符串中的 old(旧字符串) 替换成 new(新字符串),如果指定第三个参数max,则替换不超过 max 次。 语法 replace()方法语法: str.replace(old, new[, max]) 参数 old -- 将被替换的子字符串。 new - 阅读全文
posted @ 2022-03-18 18:03 Tomorrow1126 阅读(637) 评论(0) 推荐(0) 编辑
摘要: linux configure --prefix 的作用是:编译的时候用来指定程序存放路径 源码的安装一般由3个步骤组成:配置(configure)、编译(make)、安装(make install)。Configure是一个可执行脚本,它有很多选项,在待安装的源码路径下使用命令./configur 阅读全文
posted @ 2022-03-18 15:31 Tomorrow1126 阅读(215) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/liushui-sky/p/12843679.html i4k.xyz/article/qq_41854911/119454212 现在的问题是只能用/usr/bin/python3.8,用conda环境中的其他python就用不了read_cache 阅读全文
posted @ 2022-03-18 15:29 Tomorrow1126 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 设定鼠标支持 设定鼠标滚动支持,执行如下命令即可 设定鼠标滚动支持:tmux set mouse on 阅读全文
posted @ 2022-03-18 14:44 Tomorrow1126 阅读(232) 评论(0) 推荐(0) 编辑
摘要: https://stackoverflow.com/questions/70537488/cannot-import-name-registermattype-from-cv2-cv2 The same thing occurred to me yesterday when I used Colab 阅读全文
posted @ 2022-03-18 14:22 Tomorrow1126 阅读(719) 评论(0) 推荐(0) 编辑
摘要: chmod +x run_train.sh 然后就可以啦 阅读全文
posted @ 2022-03-18 14:21 Tomorrow1126 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 1.反斜杠. \ a = 1 b = 2 c = a +\ b print(c) longstring = 'this is a long long long long long long long \ string' print(longstring) 2.三引号 longstring1 = '' 阅读全文
posted @ 2022-03-18 13:34 Tomorrow1126 阅读(397) 评论(0) 推荐(0) 编辑