@@ -789,8 +789,8 @@ def train_index(exp_dir1, version19):
789
789
index .train (big_npy )
790
790
faiss .write_index (
791
791
index ,
792
- "%s/trained_IVF%s_Flat_nprobe_%s_%s.index"
793
- % (exp_dir , n_ivf , index_ivf .nprobe , version19 ),
792
+ "%s/trained_IVF%s_Flat_nprobe_%s_%s_% s.index"
793
+ % (exp_dir , n_ivf , index_ivf .nprobe , exp_dir1 , version19 ),
794
794
)
795
795
# faiss.write_index(index, '%s/trained_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
796
796
infos .append ("adding" )
@@ -800,12 +800,12 @@ def train_index(exp_dir1, version19):
800
800
index .add (big_npy [i : i + batch_size_add ])
801
801
faiss .write_index (
802
802
index ,
803
- "%s/added_IVF%s_Flat_nprobe_%s_%s.index"
804
- % (exp_dir , n_ivf , index_ivf .nprobe , version19 ),
803
+ "%s/added_IVF%s_Flat_nprobe_%s_%s_% s.index"
804
+ % (exp_dir , n_ivf , index_ivf .nprobe , exp_dir1 , version19 ),
805
805
)
806
806
infos .append (
807
- "成功构建索引,added_IVF%s_Flat_nprobe_%s_%s.index"
808
- % (n_ivf , index_ivf .nprobe , version19 )
807
+ "成功构建索引,added_IVF%s_Flat_nprobe_%s_%s_% s.index"
808
+ % (n_ivf , index_ivf .nprobe , exp_dir1 , version19 )
809
809
)
810
810
# faiss.write_index(index, '%s/added_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
811
811
# infos.append("成功构建索引,added_IVF%s_Flat_FastScan_%s.index"%(n_ivf,version19))
@@ -1029,21 +1029,21 @@ def get_info_str(strr):
1029
1029
index .train (big_npy )
1030
1030
faiss .write_index (
1031
1031
index ,
1032
- "%s/trained_IVF%s_Flat_nprobe_%s_%s.index"
1033
- % (model_log_dir , n_ivf , index_ivf .nprobe , version19 ),
1032
+ "%s/trained_IVF%s_Flat_nprobe_%s_%s_% s.index"
1033
+ % (model_log_dir , n_ivf , index_ivf .nprobe , exp_dir1 , version19 ),
1034
1034
)
1035
1035
yield get_info_str ("adding index" )
1036
1036
batch_size_add = 8192
1037
1037
for i in range (0 , big_npy .shape [0 ], batch_size_add ):
1038
1038
index .add (big_npy [i : i + batch_size_add ])
1039
1039
faiss .write_index (
1040
1040
index ,
1041
- "%s/added_IVF%s_Flat_nprobe_%s_%s.index"
1042
- % (model_log_dir , n_ivf , index_ivf .nprobe , version19 ),
1041
+ "%s/added_IVF%s_Flat_nprobe_%s_%s_% s.index"
1042
+ % (model_log_dir , n_ivf , index_ivf .nprobe , exp_dir1 , version19 ),
1043
1043
)
1044
1044
yield get_info_str (
1045
- "成功构建索引, added_IVF%s_Flat_nprobe_%s_%s.index"
1046
- % (n_ivf , index_ivf .nprobe , version19 )
1045
+ "成功构建索引, added_IVF%s_Flat_nprobe_%s_%s_% s.index"
1046
+ % (n_ivf , index_ivf .nprobe , exp_dir1 , version19 )
1047
1047
)
1048
1048
yield get_info_str (i18n ("全流程结束!" ))
1049
1049
0 commit comments