摘要:
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. 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
os.environ["CUDA_VISIBLE_DEVICES"]="0" device=torch.device('cuda' if torch.cuda.is_available() else 'cpu') 阅读全文
摘要:
解决办法: 添加find_unused_parameters=true model=torch.nn.parallel.DistributedDataParallel(model,find_unused_parameters=true) 阅读全文
摘要:
查看端口问题 netstat -nltp 找到占用端口,解除端口占用 kill -9 PID 阅读全文
摘要:
pip下载镜像 清华镜像:https://pypi.tuna.tsinghua.edu.cn/simple豆瓣镜像:https://pypi.doubanio.com/simple阿里镜像:https://mirrors.aliyun.com/pypi/simple/中国科技大学:http://py 阅读全文
摘要:
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 阅读全文
摘要:
https://pytorch.apachecn.org/docs/1.4/6.html 阅读全文
摘要:
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 阅读全文