类型错误:传递给参数的值'input'具有数据类型字符串不在允许的值列表中:int32、int64、complex64、float32、float64、bool、int8



我试图使用TensorFlow。输入属性类似于人口普查示例,但标签列是连续值。我执行了以下命令:

test-server#:〜/aaaml-samples/仲裁员$ gcloud ml-engine本地火车-Module-name Trainer.Task-绑定路径培训师/- - - train-files $ train_data-eval-eval-文件$ eval_data-训练steps 1000 -Job-dir $ model_dir

Filename:  ['/home/madhukar_mhraju/aaaml-samples/arbitrator/data/aaa.data.csv']
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
Filename:  ['/home/madhukar_mhraju/aaaml-samples/arbitrator/data/aaa.test.csv']
Filename:  ['/home/madhukar_mhraju/aaaml-samples/arbitrator/data/aaa.test.csv']
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/madhukar_mhraju/aaaml-samples/arbitrator/trainer/task.py", line 193, in <module>
    learn_runner.run(generate_experiment_fn(**arguments), job_dir)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_runner.py", line 106, in run
    return task()
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 465, in train_and_evaluate
    export_results = self._maybe_export(eval_result)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/experiment.py", line 484, in _maybe_export
    compat.as_bytes(strategy.name))))
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/export_strategy.py", line 32, in export
    return self.export_fn(estimator, export_path)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py", line 283, in export_fn
    exports_to_keep=exports_to_keep)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/framework/python/framework/experimental.py", line 64, in new_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1264, in export_savedmodel
    model_fn_lib.ModeKeys.INFER)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 1133, in _call_model_fn
    model_fn_results = self._model_fn(features, labels, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py", line 268, in _dnn_linear_combined_model_fn
    scope=scope)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/feature_column_ops.py", line 531, in weighted_sum_from_feature_columns
    transformed_tensor = transformer.transform(column)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/feature_column_ops.py", line 879, in transform
    feature_column.insert_transformed_feature(self._columns_to_tensors)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/layers/python/layers/feature_column.py", line 528, in insert_transformed_feature
    sparse_values = string_ops.as_string(input_tensor.values)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_string_ops.py", line 51, in as_string
    width=width, fill=fill, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 585, in apply_op
    param_name=input_name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py", line 61, in _SatisfiesTypeConstraint
    ", ".join(dtypes.as_dtype(x).name for x in allowed_list)))

typeError:值传递给参数'输入'的值没有数据类型字符串 在允许值列表中:INT32,INT64,COMFFELC64,FLOAT32,FLOAT64, bool,int8

Am新的tensorflow。我了解此问题正在处理评估文件(aaa.test.csv(时发生。评估文件数据和格式是正确定义的。而且列数据类型也已正确映射。但是我不确定为什么发生错误。

1(训练数据CSV中有列标题。当我生成数据时,我正在随机重新排序它们,这导致列标题移至中间的某个地方。因此类型错误。很难发现培训数据很大。

相关内容

  • 没有找到相关文章

最新更新