为什么在尝试评估 TFDF GradientBoostedTreesModel 时出现错误?

问题描述 投票:0回答:0

我一直致力于训练 tfdf.keras.GradientBoostedTreesModel,而且我经常遇到问题,我加载的模型给我一个 ValueError,说它“找不到匹配的函数来调用从 SavedModel 加载的函数。” TFDF的“known issues”页面指出,这可能是由于训练数据和我要预测的数据的数据类型不同造成的。

我一直在从同一个文件加载我的训练数据和我的预测数据(我正在为我的分类问题制作一个混淆矩阵),我使用 pandas 加载到 python 中,然后转换为张量流数据集:

labelStrings = pd.read_hdf('labelStrings.hdf5','labels').values.tolist()[0]
rawData = pd.read_hdf("identifiedData.hdf5","identified",stop=1000000)
boostedDecisionTree = tf.keras.models.load_model('bgGenBDT')
rawData['label']=rawData['label'].map(labelStrings.index) #Converting the string labels to integer ones
rawData = rawData.astype('float32')
evalData = tfdf.keras.pd_dataframe_to_tf_dataset(rawData,label='label')
results = boostedDecisionTree.predict(evalData,verbose=2)

这种转换为 float32 是我尝试解决任何不匹配数据类型的问题,并且它已经工作了几个月。然而,即使我在训练脚本中使用几乎完全相同的代码(唯一改变的是我从第 2 行的文件中读取的数据),我还是收到了 ValueError。输入功能列表一团糟,但我确实注意到错误是声称我的输入具有以下形式

{feature:<tf.Tensor 'inputs_126:0' shape=(None, 1) dtype=float32>}
当模型试图找到表单的输入时
{feature: TensorSpec(shape=(None, 1), dtype=tf.float32, name='inputs/feature')}
尽管我不确定该怎么做。以防万一这很重要,我的数据集中大约 50% 的条目是“NaN”值,尽管我过去没有看到任何问题。任何帮助/方向将不胜感激。

编辑:这是一个简化的示例和我得到的输出。

这是我写的第一个脚本,按预期工作:

import tensorflow_decision_forests as tfdf
import pandas as pd
import tensorflow as tf
import random

#Generating data to train on

rawData = [[random.uniform(0,2),random.uniform(0,2),random.randrange(0,3)] for _ in range(1000)]
data = pd.DataFrame.from_records(rawData,columns=['a','b','label']).astype('float32')
trainingData = tfdf.keras.pd_dataframe_to_tf_dataset(data,label='label')

#Training and saving the model


boostedDecisionTree = tfdf.keras.GradientBoostedTreesModel(max_depth= 6, num_trees = 10)
boostedDecisionTree.fit(trainingData)
boostedDecisionTree.save('BDT')

#Generating test data

rawData = [[random.uniform(0,2),random.uniform(0,2),random.randrange(0,3)] for _ in range(1000)]
data = pd.DataFrame.from_records(rawData,columns=['a','b','label'])
predictData = tfdf.keras.pd_dataframe_to_tf_dataset(data,label='label')

#Evaluating model on test data

results = boostedDecisionTree.predict(predictData)
resultsPD = pd.DataFrame.from_records(results)
print(resultsPD)

及其输出:

2023-05-16 14:23:40.621493: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /cvmfs/oasis.opensciencegrid.org/gluex/root-6.22.06/x86_64/lib:/cvmfs/oasis.opensciencegrid.org/gluex/xrootd/5.0.3/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evtgen/evtgen-01.07.00/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/photos/Photos-3.61/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/hepmc/HepMC-2.06.10/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/gluex_root_analysis/gluex_root_analysis-1.18.0^hdr4270/Linux_CentOS7-x86_64-gcc4.8.5-cntr/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evio/evio-4.4.6/Linux-x86_64/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/rcdb/rcdb_0.06.00/cpp/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/ccdb/ccdb_1.06.07/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/geant4/geant4.10.02.p02/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/root/root-6.08.06/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/xerces-c/xerces-c-3.1.4/lib:/.singularity.d/libs:/cvmfs/oasis.opensciencegrid.org/gluex/python3:/cvmfs/oasis.opensciencegrid.org/gluex/hdf5-1.12.0/lib
2023-05-16 14:23:40.621581: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
WARNING:root:TF Parameter Server distributed training not available.
2023-05-16 14:23:44.102919: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /cvmfs/oasis.opensciencegrid.org/gluex/root-6.22.06/x86_64/lib:/cvmfs/oasis.opensciencegrid.org/gluex/xrootd/5.0.3/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evtgen/evtgen-01.07.00/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/photos/Photos-3.61/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/hepmc/HepMC-2.06.10/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/gluex_root_analysis/gluex_root_analysis-1.18.0^hdr4270/Linux_CentOS7-x86_64-gcc4.8.5-cntr/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evio/evio-4.4.6/Linux-x86_64/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/rcdb/rcdb_0.06.00/cpp/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/ccdb/ccdb_1.06.07/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/geant4/geant4.10.02.p02/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/root/root-6.08.06/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/xerces-c/xerces-c-3.1.4/lib:/.singularity.d/libs:/cvmfs/oasis.opensciencegrid.org/gluex/python3:/cvmfs/oasis.opensciencegrid.org/gluex/hdf5-1.12.0/lib
2023-05-16 14:23:44.102996: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2023-05-16 14:23:44.103044: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (cn446): /proc/driver/nvidia/version does not exist
2023-05-16 14:23:44.103717: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-05-16 14:23:51.864524: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:185] None of the MLIR Optimization Passes are enabled (registered 2)
16/16 [==============================] - 8s 821us/step
[INFO kernel.cc:736] Start Yggdrasil model training
[INFO kernel.cc:737] Collect training examples
[INFO kernel.cc:392] Number of batches: 16
[INFO kernel.cc:393] Number of examples: 1000
[INFO kernel.cc:759] Dataset:
Number of records: 1000
Number of columns: 3

Number of columns by type:
    NUMERICAL: 2 (66.6667%)
    CATEGORICAL: 1 (33.3333%)

Columns:

NUMERICAL: 2 (66.6667%)
    0: "a" NUMERICAL mean:0.980919 min:1.23745e-05 max:1.99877 sd:0.571513
    1: "b" NUMERICAL mean:1.02036 min:0.00265199 max:1.99999 sd:0.57927

CATEGORICAL: 1 (33.3333%)
    2: "__LABEL" CATEGORICAL integerized vocab-size:4 no-ood-item

Terminology:
    nas: Number of non-available (i.e. missing) values.
    ood: Out of dictionary.
    manually-defined: Attribute which type is manually defined by the user i.e. the type was not automatically inferred.
    tokenized: The attribute value is obtained through tokenization.
    has-dict: The attribute is attached to a string dictionary e.g. a categorical attribute stored as a string.
    vocab-size: Number of unique values.

[INFO kernel.cc:762] Configure learner
[WARNING gradient_boosted_trees.cc:1643] Subsample hyperparameter given but sampling method does not match.
[WARNING gradient_boosted_trees.cc:1656] GOSS alpha hyperparameter given but GOSS is disabled.
[WARNING gradient_boosted_trees.cc:1665] GOSS beta hyperparameter given but GOSS is disabled.
[WARNING gradient_boosted_trees.cc:1677] SelGB ratio hyperparameter given but SelGB is disabled.
[INFO kernel.cc:787] Training config:
learner: "GRADIENT_BOOSTED_TREES"
features: "a"
features: "b"
label: "__LABEL"
task: CLASSIFICATION
[yggdrasil_decision_forests.model.gradient_boosted_trees.proto.gradient_boosted_trees_config] {
  num_trees: 10
  decision_tree {
    max_depth: 6
    min_examples: 5
    in_split_min_examples_check: true
    missing_value_policy: GLOBAL_IMPUTATION
    allow_na_conditions: false
    categorical_set_greedy_forward {
      sampling: 0.1
      max_num_items: -1
      min_item_frequency: 1
    }
    growing_strategy_local {
    }
    categorical {
      cart {
      }
    }
    num_candidate_attributes_ratio: -1
    axis_aligned_split {
    }
    internal {
      sorting_strategy: PRESORTED
    }
  }
  shrinkage: 0.1
  validation_set_ratio: 0.1
  early_stopping: VALIDATION_LOSS_INCREASE
  early_stopping_num_trees_look_ahead: 30
  l2_regularization: 0
  lambda_loss: 1
  mart {
  }
  adapt_subsample_for_maximum_training_duration: false
  l1_regularization: 0
  use_hessian_gain: false
  l2_regularization_categorical: 1
  apply_link_function: true
  compute_permutation_variable_importance: false
}

[INFO kernel.cc:790] Deployment config:
num_threads: 6

[INFO kernel.cc:817] Train model
[INFO gradient_boosted_trees.cc:404] Default loss set to MULTINOMIAL_LOG_LIKELIHOOD
[INFO gradient_boosted_trees.cc:1001] Training gradient boosted tree on 1000 example(s) and 2 feature(s).
[INFO gradient_boosted_trees.cc:1044] 923 examples used for training and 77 examples used for validation
[INFO gradient_boosted_trees.cc:1426]   num-trees:1 train-loss:1.088802 train-accuracy:0.431203 valid-loss:1.101725 valid-accuracy:0.285714
[INFO gradient_boosted_trees.cc:1428]   num-trees:2 train-loss:1.076015 train-accuracy:0.489707 valid-loss:1.101731 valid-accuracy:0.233766
[INFO gradient_boosted_trees.cc:1426]   num-trees:10 train-loss:1.013323 train-accuracy:0.553629 valid-loss:1.097824 valid-accuracy:0.350649
[INFO gradient_boosted_trees.cc:229] Truncates the model to 27 tree(s) i.e. 9  iteration(s).
[INFO gradient_boosted_trees.cc:263] Final model num-trees:9 valid-loss:1.093618 valid-accuracy:0.363636
[INFO kernel.cc:828] Export model in log directory: /tmp/tmp_tu93ado
[INFO kernel.cc:836] Save model in resources
[INFO kernel.cc:988] Loading model from path
[INFO decision_forest.cc:590] Model loaded with 27 root(s), 793 node(s), and 2 input feature(s).
[INFO abstract_model.cc:993] Engine "GradientBoostedTreesGeneric" built
[INFO kernel.cc:848] Use fast generic engine
2023-05-16 14:23:55.500919: W tensorflow/python/util/util.cc:348] Sets are not currently considered sequences, but this may change in the future, so consider avoiding using them.
            0         1         2
0    0.359499  0.328202  0.312299
1    0.331626  0.335902  0.332472
2    0.372847  0.307992  0.319160
3    0.371833  0.312442  0.315726
4    0.332559  0.198808  0.468633
..        ...       ...       ...
995  0.333704  0.358646  0.307650
996  0.347348  0.333341  0.319311
997  0.404316  0.313154  0.282530
998  0.344656  0.335357  0.319986
999  0.369685  0.349962  0.280352

[1000 rows x 3 columns]

这是我用来加载模型的脚本:

import pandas as pd
import tensorflow_decision_forests as tfdf
import tensorflow as tf
import random

#Generating test data

rawData = [[random.uniform(0,2),random.uniform(0,2),random.randrange(0,3)] for _ in range(1000)]
rawData = pd.DataFrame.from_records(rawData,columns=['a','b','label']).astype('float32')
rawData=rawData.drop('label',axis=1)
evalData = tfdf.keras.pd_dataframe_to_tf_dataset(rawData)

#Loading model and evaluating data

boostedDecisionTree= tf.keras.models.load_model('BDT')
results = boostedDecisionTree(evalData)
resultsPD = pd.DataFrame.from_records(results)
print(resultsPD)

我得到的错误:

2023-05-16 14:25:39.903926: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /cvmfs/oasis.opensciencegrid.org/gluex/root-6.22.06/x86_64/lib:/cvmfs/oasis.opensciencegrid.org/gluex/xrootd/5.0.3/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evtgen/evtgen-01.07.00/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/photos/Photos-3.61/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/hepmc/HepMC-2.06.10/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/gluex_root_analysis/gluex_root_analysis-1.18.0^hdr4270/Linux_CentOS7-x86_64-gcc4.8.5-cntr/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evio/evio-4.4.6/Linux-x86_64/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/rcdb/rcdb_0.06.00/cpp/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/ccdb/ccdb_1.06.07/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/geant4/geant4.10.02.p02/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/root/root-6.08.06/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/xerces-c/xerces-c-3.1.4/lib:/.singularity.d/libs:/cvmfs/oasis.opensciencegrid.org/gluex/python3:/cvmfs/oasis.opensciencegrid.org/gluex/hdf5-1.12.0/lib
2023-05-16 14:25:39.904012: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
WARNING:root:TF Parameter Server distributed training not available.
2023-05-16 14:25:43.117385: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /cvmfs/oasis.opensciencegrid.org/gluex/root-6.22.06/x86_64/lib:/cvmfs/oasis.opensciencegrid.org/gluex/xrootd/5.0.3/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evtgen/evtgen-01.07.00/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/photos/Photos-3.61/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/hepmc/HepMC-2.06.10/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/gluex_root_analysis/gluex_root_analysis-1.18.0^hdr4270/Linux_CentOS7-x86_64-gcc4.8.5-cntr/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/diracxx/Diracxx-1.0.1:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/evio/evio-4.4.6/Linux-x86_64/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/rcdb/rcdb_0.06.00/cpp/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/ccdb/ccdb_1.06.07/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/geant4/geant4.10.02.p02/lib64:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/root/root-6.08.06/lib:/group/halld/Software/builds/Linux_CentOS7-x86_64-gcc4.8.5-cntr/xerces-c/xerces-c-3.1.4/lib:/.singularity.d/libs:/cvmfs/oasis.opensciencegrid.org/gluex/python3:/cvmfs/oasis.opensciencegrid.org/gluex/hdf5-1.12.0/lib
2023-05-16 14:25:43.117498: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2023-05-16 14:25:43.117549: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:156] kernel driver does not appear to be running on this host (cn446): /proc/driver/nvidia/version does not exist
2023-05-16 14:25:43.118303: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-05-16 14:25:43.443369: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:185] None of the MLIR Optimization Passes are enabled (registered 2)
[INFO kernel.cc:988] Loading model from path
[INFO decision_forest.cc:590] Model loaded with 27 root(s), 793 node(s), and 2 input feature(s).
[INFO abstract_model.cc:993] Engine "GradientBoostedTreesGeneric" built
[INFO kernel.cc:848] Use fast generic engine
Traceback (most recent call last):
  File "mre2.py", line 10, in <module>
    results = boostedDecisionTree(evalData)
  File "/usr/local/lib/python3.6/site-packages/keras/engine/base_layer.py", line 1037, in __call__
    outputs = call_fn(inputs, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/keras/saving/saved_model/utils.py", line 68, in return_outputs_and_add_losses
    outputs, losses = fn(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/keras/saving/saved_model/utils.py", line 166, in wrap_with_training_arg
    lambda: replace_training_and_call(False))
  File "/usr/local/lib/python3.6/site-packages/keras/utils/control_flow_util.py", line 106, in smart_cond
    pred, true_fn=true_fn, false_fn=false_fn, name=name)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/framework/smart_cond.py", line 58, in smart_cond
    return false_fn()
  File "/usr/local/lib/python3.6/site-packages/keras/saving/saved_model/utils.py", line 166, in <lambda>
    lambda: replace_training_and_call(False))
  File "/usr/local/lib/python3.6/site-packages/keras/saving/saved_model/utils.py", line 162, in replace_training_and_call
    return wrapped_call(*args, **kwargs)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 885, in __call__
    result = self._call(*args, **kwds)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 933, in _call
    self._initialize(args, kwds, add_initializers_to=initializers)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 760, in _initialize
    *args, **kwds))
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/function.py", line 3066, in _get_concrete_function_internal_garbage_collected
    graph_function, _ = self._maybe_define_function(args, kwargs)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/function.py", line 3463, in _maybe_define_function
    graph_function = self._create_graph_function(args, kwargs)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/function.py", line 3308, in _create_graph_function
    capture_by_value=self._capture_by_value),
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/framework/func_graph.py", line 1007, in func_graph_from_py_func
    func_outputs = python_func(*func_args, **func_kwargs)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/eager/def_function.py", line 668, in wrapped_fn
    out = weak_wrapped_fn().__wrapped__(*args, **kwds)
  File "/usr/local/lib64/python3.6/site-packages/tensorflow/python/saved_model/function_deserialization.py", line 294, in restored_function_body
    "\n\n".join(signature_descriptions)))
ValueError: Could not find matching function to call loaded from the SavedModel. Got:
  Positional arguments (2 total):
    * <_VariantDataset shapes: {a: (None,), b: (None,)}, types: {a: tf.float32, b: tf.float32}>
    * False
  Keyword arguments: {}

Expected these arguments to match one of the following 4 option(s):

Option 1:
  Positional arguments (2 total):
    * {'b': TensorSpec(shape=(None, 1), dtype=tf.float32, name='inputs/b'), 'a': TensorSpec(shape=(None, 1), dtype=tf.float32, name='inputs/a')}
    * False
  Keyword arguments: {}

Option 2:
  Positional arguments (2 total):
    * {'a': TensorSpec(shape=(None, 1), dtype=tf.float32, name='inputs/a'), 'b': TensorSpec(shape=(None, 1), dtype=tf.float32, name='inputs/b')}
    * True
  Keyword arguments: {}

Option 3:
  Positional arguments (2 total):
    * {'a': TensorSpec(shape=(None, 1), dtype=tf.float32, name='a'), 'b': TensorSpec(shape=(None, 1), dtype=tf.float32, name='b')}
    * False
  Keyword arguments: {}

Option 4:
  Positional arguments (2 total):
    * {'a': TensorSpec(shape=(None, 1), dtype=tf.float32, name='a'), 'b': TensorSpec(shape=(None, 1), dtype=tf.float32, name='b')}
    * True
  Keyword arguments: {}
tensorflow tensorflow2.0 decision-tree tensorflow-datasets
© www.soinside.com 2019 - 2024. All rights reserved.