yuzhimanhua / Multi-BioNER

Cross-type Biomedical Named Entity Recognition with Deep Multi-task Learning (Bioinformatics'19)
https://arxiv.org/abs/1801.09851
Apache License 2.0
132 stars 28 forks source link

RuntimeError: invalid argument 2: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). #8

Closed Crucialer closed 4 years ago

Crucialer commented 4 years ago

Hello,when I reproduce the results in your paper, I meet the following probelm: image What can I do to solve it?

yuzhimanhua commented 4 years ago

Hi, thanks for raising this issue.

The errors include one line (Line 309) in crf.py

Please try to use the following line to replace 308-309: partition = utils.switch(partition, cur_partition, mask[idx].view(bat_size, 1).expand(bat_size, self.tagset_size)).view(bat_size, -1)

Also, I am not sure whether you are using pytorch 0.4 or higher. Sorry that this repo only supports pytorch 0.3.x or lower.

Crucialer commented 4 years ago

I get it. Now I'm using pytorch 0.3. But when I download the embedding from http://bio.nlplab.org/, I find the embedding is garbled and I cannot read the vector from it . image image I don't know where I went wrong. Could the embedding from http://bio.nlplab.org/ is wrong?

yuzhimanhua commented 4 years ago

Seems the embedding file from http://bio.nlplab.org/ is broken now.

Please directly use data_bioner_5/wikipedia-pubmed-and-PMC-w2v.txt.

Crucialer commented 4 years ago

ok,I succeed now. Thank you very much for your answers.