tensorflow / skflow

Simplified interface for TensorFlow (mimicking Scikit Learn) for Deep Learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exception when restore DNN model

kinddevil opened this issue · comments

I am using skflow of tensorflow(0.10.0rc0), I create a TensorFlowDNNRegressor model and saved to local, when I try to restore it gives me exception:
new_regressor = skflow.TensorFlowEstimator.restore('/Users/yichen.wei/Desktop/xiaoxiang_ml/model') File "/Users/yichen.wei/project/vscienv/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/base.py", line 326, in restore raise ValueError("Restore folder doesn't contain model definition.").

Then I add a file model.def to my model directory and restore again it gives me
new_regressor = skflow.TensorFlowEstimator.restore('/Users/yichen.wei/Desktop/xiaoxiang_ml/model') File "/Users/yichen.wei/project/vscienv/lib/python3.5/site-packages/tensorflow/contrib/learn/python/learn/estimators/base.py", line 331, in restore model_def = json.loads(fmodel.read()) File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/__init__.py", line 319, in loads return _default_decoder.decode(s) File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/Cellar/python3/3.5.2/Frameworks/Python.framework/Versions/3.5/lib/python3.5/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It seems need json model definition in model.def file but it didn't create when saving.
Could someone help with this issue? Thanks!

PS: dir of saved model :
checkpoint
events.out.tfevents
graph.pbtxt
model.ckpt-xxxx-xxxxx-of-xxxxx
model.ckpt-xxxx.meta

Please re-file bug at tensorflow repository - this one is inactive. Thanks!