CastellanZhang / alphaFM

Multi-thread implementation of Factorization Machines with FTRL for binary-class classification problem.
MIT License
885 stars 275 forks source link

预估模型报错 load model error #24

Open zzzzzbbbbb25 opened 5 years ago

zzzzzbbbbb25 commented 5 years ago

cat /data/zhangbo_ret/data/test_data/ptr_train_libsvm_data_alpha_test_off.txt | /root/work/FM_Recall/alphaFM/bin/fm_predict -core 15 -dim 8 -m /data/zhangbo_ret/data/test_data/alpha_fm_ptr_param_train.txt -mf txt -out /data/zhangbo_ret/data/test_data/alpha_fm_ptr_predict_result.txt

我训练的模型参数文件是 alpha_fm_ptr_param_train.txt ,是8维的,但是按照官网介绍的这样取预测样本时,一直报错 load model... load model error! 。 请问这是怎么回事啊/?我加了 -mf 参数还是不行。你们有遇到过吗?

lhdgriver commented 5 years ago

Hi, I've encountered the same error. I looked into alphaFM/src/FTRL/predict_model.h, the function bool predict_model<T>::load_txt_model(ifstream& in) around line 243. I found that the package use space to filter the argument, and unfortunately the feature name contains space in it... I suggest you to look into fm_model.txt, and see if you have space in feature name. I use awk '{print $1, $2}' fm_model.txt to print the first two columns, and then :g/0$/d to remove all lines ended with numbers, and found what causes the error.

LawLietzh commented 4 years ago

一直报错 load model... load model error! 不知道为啥,

glfpes commented 2 years ago

Hi, I've encountered the same error. I looked into alphaFM/src/FTRL/predict_model.h, the function bool predict_model<T>::load_txt_model(ifstream& in) around line 243. I found that the package use space to filter the argument, and unfortunately the feature name contains space in it... I suggest you to look into fm_model.txt, and see if you have space in feature name. I use awk '{print $1, $2}' fm_model.txt to print the first two columns, and then :g/0$/d to remove all lines ended with numbers, and found what causes the error.

it works, thanks buddy