diff --git a/python-package/SLIM/core.py b/python-package/SLIM/core.py index a452c79..b9622ce 100755 --- a/python-package/SLIM/core.py +++ b/python-package/SLIM/core.py @@ -625,10 +625,11 @@ def save_model(self, modelfname, mapfname): else: raise RuntimeError("Not exist a model to save.") - def load_model(self, modelfname, mapfname): + def load_model(self, modelfname, mapfname, map_dtype=np.int32): ''' @brief load a model @params modelfname: filename of the model mapfname: filename of the item map + map_dtype: data type of the map labels @return None ''' # if there is a model, destruct the model @@ -641,7 +642,7 @@ def load_model(self, modelfname, mapfname): byref(self.handle), c_char_p(modelfname.encode('utf-8'))) try: - self.id2item = np.genfromtxt(mapfname, dtype=np.int32) + self.id2item = np.genfromtxt(mapfname, dtype=map_dtype) except: self.id2item = np.genfromtxt(mapfname) self.item2id = {}