我正在尝试使用最新的docker模型运行tensorflow wide_deep训练模型。我已经将官方模型挂载到docker镜像上了
docker run -it -p 8888:8888 --mount type=bind,src="$(pwd)",target=/notebooks/model tensorflow/tensorflow
正如文档中提到的,我已经将model目录添加到python路径中。
然后我使用python download_data.py下载了数据集
关闭后,当我运行python wide_deep.py时,它抛出了这个错误
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
from ._conv import register_converters as _register_converters
INFO:tensorflow:Using config: {'_save_checkpoints_secs': 600, '_session_config': device_count {
key: "GPU"
}
, '_keep_checkpoint_max': 5, '_task_type': 'worker', '_global_id_in_cluster': 0, '_is_chief': True, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x7f69d55f0510>, '_evaluation_master': '', '_save_checkpoints_steps': None, '_keep_checkpoint_every_n_hours': 10000, '_service': None, '_num_ps_replicas': 0, '_tf_random_seed': None, '_master': '', '_num_worker_replicas': 1, '_task_id': 0, '_log_step_count_steps': 100, '_model_dir': '/tmp/census_model', '_save_summary_steps': 100}
Traceback (most recent call last):
File "wide_deep.py", line 230, in <module>
main(argv=sys.argv)
File "wide_deep.py", line 199, in main
model.train(input_fn=train_input_fn, hooks=train_hooks)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 352, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 809, in _train_model
input_fn, model_fn_lib.ModeKeys.TRAIN))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 668, in _get_features_and_labels_from_input_fn
result = self._call_input_fn(input_fn, mode)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/estimator/estimator.py", line 760, in _call_input_fn
return input_fn(**kwargs)
File "wide_deep.py", line 187, in train_input_fn
return input_fn(train_file, flags.epochs_per_eval, True, flags.batch_size)
AttributeError: 'Namespace' object has no attribute 'epochs_per_eval'我是个新手。我遗漏了什么?
发布于 2018-03-25 16:47:48
这是代码中的一个错误。将epochs_per_eval更改为epochs_between_eval。它与命令行参数解析相关。由于没有名称为epochs_per_eval的参数,因此会引发错误。
发布于 2018-04-05 00:08:47
看起来他们修复了这是主分支,但还没有进入最新版本:
https://stackoverflow.com/questions/49472920
复制相似问题