Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception when restore DNN model #4086

Closed
kinddevil opened this issue Aug 29, 2016 · 2 comments
Closed

Exception when restore DNN model #4086

kinddevil opened this issue Aug 29, 2016 · 2 comments
Assignees

Comments

@kinddevil
Copy link

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

env:
OS X EI Capitan 10.11.6
Python: 3.5.2
tensorflow: 0.10.0rc0

@poxvoculi poxvoculi added the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Aug 31, 2016
@ilblackdragon ilblackdragon removed their assignment Sep 1, 2016
@ilblackdragon
Copy link
Contributor

@ispirmustafa can you take a look?

@ilblackdragon ilblackdragon self-assigned this Sep 1, 2016
@ilblackdragon
Copy link
Contributor

ilblackdragon commented Sep 1, 2016

@kinddevil You should use DNNRegressor instead of TensorFlowDNNRegressor (which is deprecated).
Restoring is done via providing the same model_dir to the constructor.

@ilblackdragon ilblackdragon removed the stat:awaiting tensorflower Status - Awaiting response from tensorflower label Sep 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants