我尝试iris_save_restore.py
从 skflow 运行示例,根本不更改代码。
但是,我遇到了一个错误,我不确定如何继续。它似乎是从保存的文件中恢复模型时发生的。
new_classifier = skflow.TensorFlowEstimator.restore('/tmp/skflow_examples/iris_custom_model')
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
score = metrics.accuracy_score(y_test, new_classifier.predict(X_test))
print('Accuracy: {0:f}'.format(score)) File "/Users/hamayu/.pyenv/versions/anaconda2-2.5.0/lib/python2.7/site-packages/skflow/estimators/base.py", line 463, in restore
estimator._restore(path)
File "/Users/hamayu/.pyenv/versions/anaconda2-2.5.0/lib/python2.7/site-packages/skflow/estimators/base.py", line 401, in _restore
saver_def = tf.python.training.saver_pb2.SaverDef()
AttributeError: 'module' object has no attribute 'saver_pb2'
我使用以下版本:
- anaconda2-2.5.0
- tensorflow 0.7 CPU-only for Mac OS X
- skflow 0.1.0
我该如何解决?