howardhsu / BERT-for-RRC-ABSA

code for our NAACL 2019 paper: "BERT Post-Training for Review Reading Comprehension and Aspect-based Sentiment Analysis"
Apache License 2.0
455 stars 110 forks source link

windows上可以运行吗? #1

Closed 2274900 closed 4 years ago

2274900 commented 5 years ago

window上调试半天运行不了,报 def test(args): # Load a trained model that you have fine-tuned (we assume evaluate on cpu) E fixture 'args' not found

  available fixtures: cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory
  use 'pytest --fixtures [testpath]' for help on them.

我的猜测是args = parser.parse_args()中根本没有加载进去/或者这句话有问题, 这该如何解决?

此外,大佬的各种run.py文件中的 from pytorch_pretrained_bert.modeling import BertModel, PreTrainedBertModel,** BertPreTrainingHeads 报错。PreTrainedBertModel应改为BertPreTrainedModel

还有,大佬的absa_data_utils.py中没有import csv,但是直接用了csv.reader

howardhsu commented 5 years ago

Thanks for reminding me as I forgot to put Ubuntu in instructions. I didn't try windows but I think it's hard. For example, bash, compiling for apex, etc.

pytorch-pretrained-bert should be 0.4. I guess you used a newer version.

I'm not sure which version of python picked the unused csv part (from original bert code) out but you can definitely remove that function.

2274900 commented 5 years ago

Thanks for reminding me as I forgot to put Ubuntu in instructions. I didn't try windows but I think it's hard. For example, bash, compiling for apex, etc.

pytorch-pretrained-bert should be 0.4. I guess you used a newer version.

I'm not sure which version of python picked the unused csv part (from original bert code) out but you can definitely remove that function.

Thanks for reminding me as I forgot to put Ubuntu in instructions. I didn't try windows but I think it's hard. For example, bash, compiling for apex, etc.

pytorch-pretrained-bert should be 0.4. I guess you used a newer version.

I'm not sure which version of python picked the unused csv part (from original bert code) out but you can definitely remove that function.

thanks for your reply very much,and I‘m very sorry for the bother brought to you by my ignorance.I am a new fish of computer science,and know little about these konwledge ,but I should think of these issues were caused by the difference of library version and operating system。it’s so kind of you for your reminder.wish you have nice life.