【发布时间】:2018-09-03 12:05:00
【问题描述】:
我正在尝试使用最新的 docker 模型运行 tensorflow wide_deep 训练模型。我已经把官方模型挂载到docker镜像了
docker run -it -p 8888:8888 --mount type=bind,src="$(pwd)",target=/notebooks/model tensorflow/tensorflow
如文档中所述,我已将模型目录添加到 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'
我是新手。我错过了什么?
【问题讨论】:
标签: python docker tensorflow namespaces