python - tensorflow 0.9 skflow model save and restore doesn't work -


i have updated tensorflow 0.7 0.9 on python3.and can't restore previous saved models skflow(tensorflow.contrib.learn).here sample code example worked on tensorflow 0.7.

import tensorflow.contrib.learn skflow sklearn import datasets, metrics, preprocessing  boston = datasets.load_boston() x = preprocessing.standardscaler().fit_transform(boston.data) regressor = skflow.tensorflowlinearregressor() regressor.fit(x, boston.target) score = metrics.mean_squared_error(regressor.predict(x), boston.target) print ("mse: %f" % score)  regressor.save('/home/model/')  classifier = skflow.tensorflowestimator.restore('/home/model/') 

on tensorflow 0.9 have recieved errors.

attributeerror: 'tensorflowlinearregressor' object has no attribute '_restore' 

i belive save , restore have been deprecated in favor of model_dir param when building estimator/regressor :

regressor = skflow.tensorflowlinearregressor(model_dir='/home/model/') regressor.fit(x, boston.target) ... estimator = skflow.tensorflowlinearregressor(model_dir='/home/model/') estimator.predict(...) 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -