zjukg / NeuralKG

[Tool] For Knowledge Graph Representation Learning
http://neuralkg.zjukg.org/
Apache License 2.0
348 stars 63 forks source link

main函数中似乎有路径错误 #37

Closed shannon-paul closed 1 year ago

shannon-paul commented 1 year ago

我正在尝试执行CCKS中的Grail脚本,但是在main函数中这几行似乎是错误的 image 这里的model_checkpoint.best_model_path是空值,我按照README_CCKS中的流程尝试跑一个epoch,会报以下错误 image 我检查了main中的代码逻辑,发现这里似乎应该改为model_checkpoint.dirpath,不知道我的想法是否正确?谢谢!

hzwy3c commented 1 year ago

您好,

非常感谢您对我们提出的宝贵建议,这里面的best_model_path是pytorch_lightning框架中封装好的用法,用来检索最佳checkpoint的路径,所以在main.py里面用best_model_path是没问题的,dirpath只是checkpoint所在的目录路径。您在跑一个epoch的时候model_checkpoint.best_model_path是空值是因为脚本里面的check_per_step/check_per_epoch大于一个epoch导致他还没有进行validation,您可以尝试调高epoch或者调低check_per_step/check_per_epoch

shannon-paul commented 1 year ago

您好,

非常感谢您对我们提出的宝贵建议,这里面的best_model_path是pytorch_lightning框架中封装好的用法,用来检索最佳checkpoint的路径,所以在main.py里面用best_model_path是没问题的,dirpath只是checkpoint所在的目录路径。您在跑一个epoch的时候model_checkpoint.best_model_path是空值是因为脚本里面的check_per_step/check_per_epoch大于一个epoch导致他还没有进行validation,您可以尝试调高epoch或者调低check_per_step/check_per_epoch

确实是epoch过小导致的,感谢作者的回答 :)👍

hzwy3c commented 1 year ago

不客气,有问题欢迎随时提出~