ShomyLiu / pytorch-pcnn

supervised relation extraction for PCNN (Zeng 2014) in pytorch 关系抽取
137 stars 40 forks source link

训练时出错 #4

Closed Foehnc closed 5 years ago

Foehnc commented 5 years ago

训练时出现如下错误 请问一下怎么解决?


user config:


loading train data loading finish loading test data loading finish train data: 8000; test data: 2717 Traceback (most recent call last): File "main_sem.py", line 123, in fire.Fire() File "/home/lullaby/.local/lib/python2.7/site-packages/fire/core.py", line 127, in Fire component_trace = _Fire(component, args, context, name) File "/home/lullaby/.local/lib/python2.7/site-packages/fire/core.py", line 366, in _Fire component, remaining_args) File "/home/lullaby/.local/lib/python2.7/site-packages/fire/core.py", line 542, in _CallCallable result = fn(*varargs, **kwargs) File "main_sem.py", line 75, in train model.save(name="SEM_CNN") File "/home/lullaby/知识抽取/关系抽取/pytorch-pcnn/models/BasicModule.py", line 32, in save torch.save(self.state_dict(), name) File "/home/lullaby/.local/lib/python2.7/site-packages/torch/serialization.py", line 218, in save return _with_file_like(f, "wb", lambda f: _save(obj, f, pickle_module, pickle_protocol)) File "/home/lullaby/.local/lib/python2.7/site-packages/torch/serialization.py", line 141, in _with_file_like f = open(f, mode) IOError: [Errno 2] No such file or directory: 'checkpoints/PCNN_SEM_CNN.pth'

ShomyLiu commented 5 years ago

在目录下 新建一个 checkpoints文件夹即可

Foehnc commented 5 years ago

@ShomyLiu 问题已经解决 感谢您的回复

ShomyLiu commented 5 years ago

因为git不识别空目录,因此checkpoints没有上传上去。 已修复。