(model, imp_script) = script_runner.load_model(script, image_dir) script_runner.run(model) print 'completed model run for: {0}'.format(script) if hasattr(imp_script, 'post_run'): imp_script.post_run(model) print 'completed post model run for: {0}'.format(script) # save model _state saveloc = os.path.join(os.path.dirname(script), 'save_model') # make sure it is rewound so we're not doing a MIDRUN save # which does not currently work model.rewind() script_runner.save(model, saveloc) print 'completed saving model _state for: {0}'.format(script) try: script_runner.run_from_save(saveloc) print ('completed loading and running saved model _state ' 'from: {0}'.format(saveloc)) except Exception, ex: print ('Exception in script_runner.run_from_save(saveloc)' '\n\t{0}'.format(ex))
(model, imp_script) = script_runner.load_model(script, image_dir) script_runner.run(model) print 'completed model run for: {0}'.format(script) if hasattr(imp_script, 'post_run'): imp_script.post_run(model) print 'completed post model run for: {0}'.format(script) # save model _state saveloc = os.path.join(os.path.dirname(script), 'save_model') # make sure it is rewound so we're not doing a MIDRUN save # which does not currently work model.rewind() script_runner.save(model, saveloc) print 'completed saving model _state for: {0}'.format(script) try: script_runner.run_from_save(os.path.join(saveloc, 'Model.json')) print ('completed loading and running saved model _state ' 'from: {0}'.format(saveloc)) except Exception, ex: print ('Exception in script_runner.run_from_save(saveloc)' '\n\t{0}'.format(ex))