would you provide pre-train model
Closed this issue · 5 comments
我也遇到了同样的问题
Hi, sorry for the late reply. The provided RECCE weighs are the model parameters which could be used for testing. The 'bin' file is just used for debugging which contains some additional information.
You can convert the provided RECCE weights stored in 'pickle' file to 'bin' file using the code below.
import torch
import argparse
def arg_parser():
parser = argparse.ArgumentParser(description="pickle2bin utility")
parser.add_argument("--path", "-p",
type=str,
required=True,
help="Specify the path of the pickle file to "
"translate into bin file.")
return parser.parse_args()
if __name__ == '__main__':
arg = arg_parser()
print(f"Loading pickle file from '{arg.path}'.")
model_params = torch.load(arg.path, map_location="cpu")
torch.save({
"model": model_params,
"step": -1,
"best_step": -1,
"best_metric": torch.tensor(-1.),
"eval_metric": "Unknown"
}, arg.path.replace(".pickle", ".bin"))
print(f"Converted pickle file to bin file stored in "
f"'{arg.path.replace('.pickle', '.bin')}'.")
Supposed you have named the above code as pickle2bin.py
, you can run
python pickle2bin.py --path model_params_ffpp_c40.pickle
to translate the 'pickle' weights into 'bin' file for testing. Please also note that you may need to modify the value of config/ckpt
in the model configuration file, ie, replace the default value best_model_1000
to model_params_ffpp_c40
.
我也遇到了同样的问题
太难了
Hi, sorry for the late reply. The provided RECCE weighs are the model parameters which could be used for testing. The 'bin' file is just used for debugging which contains some additional information.
You can convert the provided RECCE weights stored in 'pickle' file to 'bin' file using the code below.
import torch import argparse def arg_parser(): parser = argparse.ArgumentParser(description="pickle2bin utility") parser.add_argument("--path", "-p", type=str, required=True, help="Specify the path of the pickle file to " "translate into bin file.") return parser.parse_args() if __name__ == '__main__': arg = arg_parser() print(f"Loading pickle file from '{arg.path}'.") model_params = torch.load(arg.path, map_location="cpu") torch.save({ "model": model_params, "step": -1, "best_step": -1, "best_metric": torch.tensor(-1.), "eval_metric": "Unknown" }, arg.path.replace(".pickle", ".bin")) print(f"Converted pickle file to bin file stored in " f"'{arg.path.replace('.pickle', '.bin')}'.")Supposed you have named the above code as
pickle2bin.py
, you can runpython pickle2bin.py --path model_params_ffpp_c40.pickleto translate the 'pickle' weights into 'bin' file for testing. Please also note that you may need to modify the value of
config/ckpt
in the model configuration file, ie, replace the default valuebest_model_1000
tomodel_params_ffpp_c40
.
thanks a lot,It helps me a lot
thanks a lot, it helps me a lot
@Pudge-tao what is the name of the pickle file and where to find it?
@Pudge-tao what is the name of the pickle file and where to find it?
chat18.aichatos.xyz/#/chat/1698070039905