machine learning - Encog - Error saving network weights, Not a valid EG file -
i've got network trained , want save , able load later don't have re-train it... duh.
end of training code:
//save network serializeobject.save(new file("encognet"),network); encog.getinstance().shutdown();
loading file
basicnetwork network = (basicnetwork) encogdirectorypersistence.loadobject(new file("encognet"));
i error
exception in thread "main" org.encog.persist.persisterror: not valid eg file.
can tell me how fix this?
i think problem not saving file .eg
extension. if not problem, i'm not sure serializeobject.save
, know encogdirectorypersistence
works me.
so, test out code saving
public static final string filename = "test_load_net.eg"; encogdirectorypersistence.saveobject(new file(filename), network);
and load this
public static final string filename = "test_load_net.eg"; basicnetwork network = (basicnetwork)encogdirectorypersistence.loadobject(new file(filename));
Comments
Post a Comment