Closed tathanwu closed 3 years ago
如果移动存储模型目录, 除了修改地址path_hyper_parameter,文件hyper_parameters.json里边的路径也需要修改
Same issue here.
Using TensorFlow backend. Traceback (most recent call last): File "C:/Users/ewuxtai/PycharmProjects/Keras-TextClassification-master/keras_textclassification/m01_FastText/predict.py", line 131, in pred_tet(path_test=path_baidu_qa_2019_valid, rate=1) # sample条件下设为1,否则训练语料可能会很少 File "C:/Users/ewuxtai/PycharmProjects/Keras-TextClassification-master/keras_textclassification/m01_FastText/predict.py", line 38, in pred_tet hyper_parameters = load_json(path_hyper_parameter) File "C:\Users\ewuxtai\PycharmProjects\Keras-TextClassification-master\keras_textclassification\data_preprocess\text_preprocess.py", line 136, in load_json with open(path, 'r', encoding='utf-8') as fj: FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/ewuxtai/PycharmProjects/Keras-TextClassification-master/keras_textclassification/data/model/fast_text/hyper_parameters.json'
Solved! first run python m01_FastText/train.py to generate related file. the file is saved into you envs location eg. envs/TF12/lib/python3.6/site-packages/keras_textclassification/data/model/fast_text/...
Using TensorFlow backend. Traceback (most recent call last): File "C:/Users/ewuxtai/PycharmProjects/Keras-TextClassification-master/keras_textclassification/m01_FastText/predict.py", line 131, in
pred_tet(path_test=path_baidu_qa_2019_valid, rate=1) # sample条件下设为1,否则训练语料可能会很少
File "C:/Users/ewuxtai/PycharmProjects/Keras-TextClassification-master/keras_textclassification/m01_FastText/predict.py", line 38, in pred_tet
hyper_parameters = load_json(path_hyper_parameter)
File "C:\Users\ewuxtai\PycharmProjects\Keras-TextClassification-master\keras_textclassification\data_preprocess\text_preprocess.py", line 136, in load_json
with open(path, 'r', encoding='utf-8') as fj:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/ewuxtai/PycharmProjects/Keras-TextClassification-master/keras_textclassification/data/model/fast_text/hyper_parameters.json'