Fork me on GitHub 0
摘要: x = torch.tensor([1, 2, 3]) tensor([[1, 1, 1], [2, 2, 2], [3, 3, 3]]) x.reshape(-1) tensor([1, 1, 1, 2, 2, 2, 3, 3, 3]) view a = torch.arange(0,20) a. 阅读全文
posted @ 2020-09-23 22:36 amazingcode 阅读(185) 评论(0) 推荐(0) 编辑
摘要: cuda9.1下载链接 https://developer.nvidia.com/cuda-91-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1704&target_t 阅读全文
posted @ 2020-09-22 19:00 amazingcode 阅读(798) 评论(0) 推荐(0) 编辑
摘要: 1.1 list 转 numpy ndarray = np.array(list) 1.2 numpy 转 list list = ndarray.tolist() 2.1 list 转 torch.Tensor tensor=torch.Tensor(list) 2.2 torch.Tensor  阅读全文
posted @ 2020-08-18 21:45 amazingcode 阅读(313) 评论(0) 推荐(0) 编辑
摘要: os.environ["CUDA_VISIBLE_DEVICES"]="0" device=torch.device('cuda' if torch.cuda.is_available() else 'cpu') 阅读全文
posted @ 2020-08-07 17:30 amazingcode 阅读(512) 评论(0) 推荐(0) 编辑
摘要: 解决办法: 添加find_unused_parameters=true model=torch.nn.parallel.DistributedDataParallel(model,find_unused_parameters=true) 阅读全文
posted @ 2020-07-18 20:17 amazingcode 阅读(6426) 评论(0) 推荐(0) 编辑
摘要: 查看端口问题 netstat -nltp 找到占用端口,解除端口占用 kill -9 PID 阅读全文
posted @ 2020-07-18 20:12 amazingcode 阅读(171) 评论(0) 推荐(0) 编辑
摘要: pip下载镜像 清华镜像:https://pypi.tuna.tsinghua.edu.cn/simple豆瓣镜像:https://pypi.doubanio.com/simple阿里镜像:https://mirrors.aliyun.com/pypi/simple/中国科技大学:http://py 阅读全文
posted @ 2020-07-16 16:31 amazingcode 阅读(214) 评论(0) 推荐(0) 编辑
摘要: torchtorchvisionpython master / nightly master / nightly >=3.6 1.6.0 0.7.0 >=3.6 1.5.1 0.6.1 >=3.5 1.5.0 0.6.0 >=3.5 1.4.0 0.5.0 ==2.7, >=3.5, <=3.8 1 阅读全文
posted @ 2020-07-16 15:44 amazingcode 阅读(24697) 评论(0) 推荐(2) 编辑
摘要: https://pytorch.apachecn.org/docs/1.4/6.html 阅读全文
posted @ 2020-06-14 17:47 amazingcode 阅读(216) 评论(0) 推荐(0) 编辑
摘要: np.stack 沿着新的轴加入一系列的数组 >>> arrays = [np.random.randn(3, 4) for _ in range(10)] >>> np.stack(arrays, axis=0).shape (10, 3, 4) >>> np.stack(arrays, axis 阅读全文
posted @ 2020-05-19 16:07 amazingcode 阅读(233) 评论(0) 推荐(0) 编辑