Skip to content

[Bug] 测试模型时报错:object has no attribute 'json_log_path' #51

Open
@zhangpeihao

Description

@zhangpeihao

Checklist before your report.

  • I have verified that the issue exists against the master branch of AdaSeq.
  • I have read the relevant section in the contribution guide on reporting bugs.
  • I have checked the issues list for similar or identical bug reports.
  • I have checked the pull requests list for existing proposed fixes.
  • I have checked the commit log to find out if the bug was already fixed in the master branch.

What happened?

运行测试模型代码保存:
object has no attribute 'json_log_path'

Python traceback

show/hide

发生异常: AttributeError
'AdaSeqTextLoggerHook' object has no attribute 'json_log_path'
  File "/codes/hg/raner-trainer/AdaSeq/adaseq/training/hooks/text_logger_hook.py", line 81, in _dump_log
    with open(self.json_log_path, 'a+') as f:
  File "/codes/hg/raner-trainer/AdaSeq/adaseq/training/default_trainer.py", line 142, in dump_log
    self._file_logger._dump_log(log_dict)
  File "/codes/hg/raner-trainer/AdaSeq/adaseq/training/default_trainer.py", line 164, in test
    self.dump_log(log_dict)
  File "/codes/hg/raner-trainer/AdaSeq/adaseq/commands/test.py", line 93, in test_model
    trainer.test(checkpoint_path)
  File "/codes/hg/raner-trainer/test.py", line 17, in main
    test_model(args.work_dir, args.device, args.checkpoint_path)
  File "/codes/hg/raner-trainer/test.py", line 28, in <module>

Operating system

Linux B760M-H-DDR4 6.8.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 13 13:35:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Python version

3.8.20

Output of pip freeze

show/hide

addict==2.4.0
aiohappyeyeballs==2.4.4
aiohttp==3.10.11
aiosignal==1.3.1
aliyun-python-sdk-core==2.16.0
aliyun-python-sdk-kms==2.16.5
async-timeout==5.0.1
attrs==25.1.0
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
crcmod==1.7
cryptography==44.0.0
datasets==3.1.0
dill==0.3.6
einops==0.8.0
filelock==3.16.1
frozenlist==1.5.0
fsspec==2024.9.0
gast==0.6.0
huggingface-hub==0.28.1
idna==3.10
Jinja2==3.1.5
jmespath==0.10.0
joblib==1.4.2
MarkupSafe==2.1.5
modelscope==1.22.3
mpmath==1.3.0
multidict==6.1.0
multiprocess==0.70.14
networkx==3.1
numpy==1.24.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==9.1.0.70
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.20.5
nvidia-nvjitlink-cu12==12.8.61
nvidia-nvtx-cu12==12.1.105
oss2==2.19.1
packaging==24.2
pandas==2.0.3
pillow==10.4.0
platformdirs==4.3.6
propcache==0.2.0
pyarrow==17.0.0
pycparser==2.22
pycryptodome==3.21.0
python-dateutil==2.9.0.post0
pytz==2025.1
PyYAML==6.0.2
regex==2024.11.6
requests==2.32.3
responses==0.18.0
safetensors==0.5.2
scikit-learn==1.3.2
scipy==1.10.1
seqeval==1.2.2
simplejson==3.19.3
six==1.17.0
sortedcontainers==2.4.0
sympy==1.13.3
threadpoolctl==3.5.0
tokenizers==0.20.3
tomli==2.2.1
torch==2.4.1
tqdm==4.67.1
transformers==4.46.3
triton==3.0.0
typing_extensions==4.12.2
tzdata==2025.1
urllib3==2.2.3
xxhash==3.5.0
yapf==0.43.0
yarl==1.15.2

How to reproduce

show/hide


python train.py -c ./dataset/address-ner-ccks-2021.yaml
python test.py -w experiments/address-ner-ccks-2021/250209105418.521539

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions