fastNLP icon indicating copy to clipboard operation
fastNLP copied to clipboard

fastNLP: A Modularized and Extensible NLP Framework. Currently still in incubation.

Results 71 fastNLP issues
Sort by recently updated
recently updated
newest added

fastnlp目前只有文本分类这种单个文本输入的示例,对于文本匹配任务 这种有两个文本的输入,文档中并没有案例,我在网络上也没有搜到相关案例,希望能增加一个相关案例

做pos-tag任务时,使用ConllLoader读取数据集,数据首行为: -DOCSTART- -X- O O 按照文档说明是不会读入这行的,但实际使用时读入了 ![image](https://user-images.githubusercontent.com/28834990/163525201-18551c2f-ffca-469e-82d3-29cdaf696f1b.png) 刚接触NER,不知道是不是bug

在py3.9, torch1.11下,使用Trainer报了一个错误: RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [32, 50, 711]], which is output 0 of ReluBackward0, is at...

文本分类样例代码在CPU模式下正常运行,但是GPU运行报错,错误如下: RuntimeError: 'lengths' argument should be a 1D CPU int64 tensor, but got 1D cuda:0 Long tensor

bug

感谢开源 NER任务,同样的模型结构,使用Static embedding可以得到正常的结果,使用bert embedding loss可以正常下降,但评估结果一直都是0。大概是什么原因呢?是词表对不上吗?我看了代码,应该有把本地vocab和bert的vocab做映射。不过有一点很奇怪,我打印了同一个字符的embedding值,每次打印结果都不一样,是随机初始化的吗还是预训练模型没有成功读取?

Description:修复Trainer里check_code函数忽略pin_memory参数导致的内存不足bug Main reason: 在使用fastNLP库时发生内存不足错误。使用场景是在使用CPU训练模型时,发生了内存错误。经过DEBUG发现,是core/trainer.py文件里,_check_code函数在调用Tester类时没有指定pin_memory参数,而Tester类默认初始化pin_memory为True。 具体错误调用栈: ``` THCudaCheck FAIL file=/pytorch/aten/src/THC/THCCachingHostAllocator.cpp line=278 error=2 : out of memory Traceback (most recent call last): File "/data/ouyhlan/TextClassification/main.py", line 52, in trainer = Trainer(train_data=data_bundle.get_dataset('train'), model=model, loss=loss,...

**Describe the bug** 当device不为cpu时,使用elmo_embedding时发生错误: File "fastNLP/fastNLP/embeddings/elmo_embedding.py", line 329, in forward token_embedding = token_embedding.masked_fill(mask, 0) RuntimeError: expected self and mask to be on the same device, but got mask on cpu...

![image](https://user-images.githubusercontent.com/68452249/142417538-a593b9c2-c9a1-4cfd-a5d2-2beac1764866.png) Metric是只评估验证集么?没大看懂。生成的fitlog里SpanFpreRec与SpanFpreRec-data-test曲线也是完全相同。实在是不明白。。

**Describe the bug** 如题 **Screenshots** ![ROIPU_$Y2SZJODLJRPBEAZ9](https://user-images.githubusercontent.com/64841244/138550196-eb7a5b92-cb78-4329-a0ad-f8d2a9db6723.png)