gpt4 book ai didi

python - 属性错误 : 'Namespace' object has no attribute 'epochs_per_eval'

转载 作者:行者123 更新时间:2023-12-04 17:06:46 27 4
gpt4 key购买 nike

我正在尝试使用最新的 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'

我是新手。我错过了什么?

最佳答案

这是代码中的错误。改 epochs_per_evalepochs_between_eval .它与命令行参数解析有关。因为没有名称 epochs_per_eval 的参数它引发了一个错误。

关于python - 属性错误 : 'Namespace' object has no attribute 'epochs_per_eval' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49472920/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com