![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
cxxx17
为什么可乐一定要加冰
展开
-
【ST】M2BART
语音和语言模型向着统一的方向发展,一个单独的模型可以解决200种语言的翻译和100种语言的转写。统一的模型简化了开发,部署,更重要的是在低资源的音频上实现了知识的迁移。这篇论文引入了M2BART,一个流式的多语言和多模态的encoder-decoder模型。他应用了自监督的speech tokenizer, 建立起语音和文本之间的桥梁。用统一的学习目标学习单模态和多模态知识,应用unsupervised 和 supervised的数据。原创 2024-05-15 00:55:22 · 802 阅读 · 0 评论 -
【debug】torch weight norm device
weight norm原创 2023-02-05 16:36:37 · 226 阅读 · 0 评论 -
【debug】PytorchStreamReader failed reading zip archive: failed finding central directory
libtorch(版本1.7)读取pytorch(版本1.4)中存的tensor时,报错PytorchStreamReader failed reading zip archive: failed finding central directorysave的代码:torch.save(cur_tensor, "cur_tensor.pt")尝试了网上的方法:torch.save(cur_tensor, "cur_tensor.pt", _use_new_zipfile_serialization=原创 2021-11-18 16:53:11 · 6715 阅读 · 0 评论 -
【debug】 indexSelectLargeIndex: block: [x,0,0], thread: [x,0,0] Assertion `srcIndex < 解决
用了torch里面的nn.Embedding层,报错:RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED/pytorch/aten/src/ATen/native/cuda/Indexing.cu:658: indexSelectLargeIndex: block: [234,0,0], thread: [102,0,0] Assertion srcIndex < srcSelectDimSize failed.检查发现是输入nn.Em原创 2021-09-16 10:58:13 · 13733 阅读 · 9 评论 -
【debug】error: no matching function for call to ‘from_blob‘
应用libtorch将数据转为tensor时,报错error: no matching function for call to ‘from_blob’。检查发现并不是libtorch版本/libtorch没include进来等问题,是torch::from_blob(vec.data(), {1, row, clo})中的vec.data()的数据格式的问题,给的matrix报错,改成vec.data()就好了。...原创 2021-09-14 10:56:51 · 540 阅读 · 0 评论 -
【debug】RuntimeError: DataLoader worker (pid(s) xxx) exited unexpectedly
跑着跑着出现Bug:RuntimeError: DataLoader worker (pid(s) 689998) exited unexpectedly。worker开太大了,原来用的是16,改成12之后不会报错了。原创 2021-08-31 15:17:39 · 4144 阅读 · 1 评论 -
【debug】ld: unknown option: --no-as-needed
ld: unknown option: --no-as-needed原创 2021-08-16 18:48:15 · 1020 阅读 · 0 评论 -
安装指定cuda版本的torch
安装指定cuda版本的torch:pytorch原创 2021-08-10 16:56:48 · 3323 阅读 · 0 评论 -
Hugging Face 预训练模型的下载及使用
以bert-base-chinese为例,首先到hugging face的model页,搜索需要的模型,进到该模型界面。在本地建个文件夹:mkdir -f model/bert/bert-base-chinese将config.json、pytorch_model.bin(与tf_model.h5二选一,用什么框架选什么)、tokenizer.json、vocab.txt下载到刚才新建的文件夹中。(对于一般的模型config.json、tokenizer.json、pytorch_model.b原创 2021-03-10 19:25:24 · 9168 阅读 · 3 评论 -
【debug】waveglow踩坑
waveglow踩坑原创 2021-03-09 14:37:34 · 552 阅读 · 0 评论 -
【debug】RuntimeError: cuda runtime error (700) : an illegal memory access was encountered解决
运行pytorch程序时,因为中间有把数据转成cpu的操作,跑多卡时会把报错:RuntimeError: cuda runtime error (700) : an illegal memory access was encountered at /pytorch/aten/src/THC/THCCachingHostAllocator.cpp直接改成跑单卡,或者把中间的cpu部分的运算全都改到gpu上。...原创 2021-03-08 20:18:53 · 3253 阅读 · 0 评论 -
【debug】ValueError: all the input arrays must have same number of dimensions 解决
使用# T是个整数tensornp.concatenate((align[1:],T.cpu().numpy()), axis=0)报错ValueError: all the input arrays must have same number of dimensions, but the array at index 0 has 1 dimension(s) and the array at index 1 has 0 dimension(s)查看align[1:]及T.cpu().numpy(原创 2021-02-14 23:47:40 · 3738 阅读 · 0 评论 -
【debug】TypeError: Caught TypeError in replica 1 on device 1
在程序中分配了一个gpu, 但运行时给程序两个gpu原创 2021-02-11 11:44:49 · 2955 阅读 · 1 评论 -
【debug】torch.cuda.is_available()返回false原因
跑pytroch代码时出现错误:RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False经排查发现是该服务器的驱动版本较老,不支持torch需要的cuda版本。如果用cpu跑也可以接受的话,参考cpu。...原创 2021-02-02 18:20:23 · 254 阅读 · 0 评论 -
import torchtext error: AttributeError: module ‘torch‘ has no attribute ‘ops‘
import torchtext时出现了errorAttributeError: module 'torch' has no attribute 'ops'查看了torchtext版本为0.8.0卸载后,安装torchtext 0.6.0 后可以成功import原创 2020-11-04 20:36:36 · 1762 阅读 · 0 评论