![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
错误异常处理
Y.zzz
随心笔记
展开
-
【自定义数据迭代器报错TypeError: object.__new__() takes exactly one argument (the type to instantiate)】
TypeError: object.__new__() takes exactly one argument (the type to instantiate)原创 2023-08-01 10:34:25 · 441 阅读 · 2 评论 -
pytorch版本的问题--实现Gradient Flipping梯度反转
旧版定义一个类,然后用函数的方式去调用:from torch.autograd import Functionclass GradReverse(Function): def __init__(self, lambd): self.lambd = lambd def forward(self, x): return x.view_as(x) def backward(self, grad_output): return (.原创 2021-12-15 20:15:24 · 1724 阅读 · 0 评论 -
pycharm中解决同一目录下py文件不能import的问题
选择当前文件夹,右键mark Directory as–Source Root原创 2022-03-01 11:19:59 · 953 阅读 · 0 评论 -
解决spacy中“Can‘t find model ‘en_core_web_trf‘. It dosen‘t seem to be a shortcur link”
spacy安装包原创 2022-10-07 17:03:05 · 887 阅读 · 0 评论 -
python处理CSV的错误‘utf8’ codec can’t decode byte 0xc3 in position 0
CSV编码问题原创 2022-10-06 16:39:25 · 655 阅读 · 0 评论 -
StopIteration: Caught StopIteration in replica 0 on device 0.
方法:next(self.parameters()).dtype换成torch.float32。原创 2022-03-28 19:35:33 · 1399 阅读 · 0 评论 -
extended_attention_mask = extended_attention_mask.to(dtype=torch.float32) StopIteration
extended_attention_mask = extended_attention_mask.to(dtype=torch.float32) StopIteration。原创 2022-11-03 16:27:07 · 565 阅读 · 1 评论 -
安装anaconda
conda未找到命令原创 2022-11-03 11:04:51 · 206 阅读 · 0 评论 -
ERROR: Cannot uninstall ‘PyYAML‘. It is a distutils installed project and thus we cannot accurately
试了好多方法,终于pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --ignore-installed但是还有2个包没更新,ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of原创 2021-04-18 13:46:36 · 233 阅读 · 0 评论