aymericdamien / TensorFlow-Examples

TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)
Other
43.43k stars 14.94k forks source link

Add GBDT example #379

Closed aymericdamien closed 4 years ago

jbrepogmailcom commented 2 years ago

Hello, seems like this example does not work anymore because features were deprecated:

2022-02-25 15:44:55.014545: 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 WARNING:tensorflow:From /home/janbenes/.local/lib/python3.9/site-packages/tensorflow/python/util/lazy_loader.py:59: The name tf.estimator.inputs is deprecated. Please use tf.compat.v1.estimator.inputs instead.

WARNING:tensorflow:From /home/janbenes/GBDT.py:45: The name tf.estimator.inputs.numpy_input_fn is deprecated. Please use tf.compat.v1.estimator.inputs.numpy_input_fn instead.

WARNING:tensorflow:From /home/janbenes/GBDT.py:57: BoostedTreesClassifier.init (from tensorflow_estimator.python.estimator.canned.boosted_trees) is deprecated and will be removed in a future version. Instructions for updating: Boosted Trees kernels in TF are deprecated. Please use TensorFlow Decision Forests instead (https://github.com/tensorflow/decision-forests) WARNING:tensorflow:Using temporary folder as model directory: /tmp/tmp7dreu5fa WARNING:tensorflow:From /home/janbenes/.local/lib/python3.9/site-packages/tensorflow/python/training/training_util.py:396: Variable.initialized_value (from tensorflow.python.ops.variables) is deprecated and will be removed in a future version. Instructions for updating: Use Variable.read_value. Variables in 2.X are initialized automatically both in eager and graph (inside tf.defun) contexts. 2022-02-25 15:44:56.930293: 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 2022-02-25 15:44:56.930317: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303) WARNING:tensorflow:From /home/janbenes/.local/lib/python3.9/site-packages/tensorflow_estimator/python/estimator/inputs/queues/feeding_queue_runner.py:60: QueueRunner.init (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version. Instructions for updating: To construct input pipelines, use the tf.data module. WARNING:tensorflow:From /home/janbenes/.local/lib/python3.9/site-packages/tensorflow_estimator/python/estimator/inputs/queues/feeding_functions.py:491: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version. Instructions for updating: To construct input pipelines, use the tf.data module. WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:From /home/janbenes/.local/lib/python3.9/site-packages/tensorflow/python/training/monitored_session.py:914: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version. Instructions for updating: To construct input pipelines, use the tf.data module. WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:It seems that global step (tf.train.get_global_step) has not been increased. Current value (could be stable): 0 vs previous value: 0. You could increase the global step by passing tf.train.get_global_step() to Optimizer.apply_gradients or Optimizer.minimize. WARNING:tensorflow:It seems that global step (tf.train.get_global_step) has not been increased. Current value (could be stable): 0 vs previous value: 0. You could increase the global step by passing tf.train.get_global_step() to Optimizer.apply_gradients or Optimizer.minimize. WARNING:tensorflow:It seems that global step (tf.train.get_global_step) has not been increased. Current value (could be stable): 0 vs previous value: 0. You could increase the global step by passing tf.train.get_global_step() to Optimizer.apply_gradients or Optimizer.minimize. WARNING:tensorflow:It seems that global step (tf.train.get_global_step) has not been increased. Current value (could be stable): 0 vs previous value: 0. You could increase the global step by passing tf.train.get_global_step() to Optimizer.apply_gradients or Optimizer.minimize. WARNING:tensorflow:It seems that global step (tf.train.get_global_step) has not been increased. Current value (could be stable): 0 vs previous value: 0. You could increase the global step by passing tf.train.get_global_step() to Optimizer.apply_gradients or Optimizer.minimize. WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:From /home/janbenes/.local/lib/python3.9/site-packages/tensorflow_estimator/python/estimator/canned/head.py:635: auc (from tensorflow.python.ops.metrics_impl) is deprecated and will be removed in a future version. Instructions for updating: The value of AUC returned by this may race with the update so this is deprecated. Please use tf.keras.metrics.AUC instead. WARNING:tensorflow:Trapezoidal rule is known to produce incorrect PR-AUCs; please switch to "careful_interpolation" instead. WARNING:tensorflow:Trapezoidal rule is known to produce incorrect PR-AUCs; please switch to "careful_interpolation" instead. WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:Trapezoidal rule is known to produce incorrect PR-AUCs; please switch to "careful_interpolation" instead. WARNING:tensorflow:Trapezoidal rule is known to produce incorrect PR-AUCs; please switch to "careful_interpolation" instead. WARNING:tensorflow:From /home/janbenes/GBDT.py:86: BoostedTreesRegressor.init (from tensorflow_estimator.python.estimator.canned.boosted_trees) is deprecated and will be removed in a future version. Instructions for updating: Boosted Trees kernels in TF are deprecated. Please use TensorFlow Decision Forests instead (https://github.com/tensorflow/decision-forests) WARNING:tensorflow:Using temporary folder as model directory: /tmp/tmpdsqjlm3a WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name' WARNING:tensorflow:Issue encountered when serializing resources. Type is unsupported, or the types of the items don't match field type in CollectionDef. Note this is a warning and probably safe to ignore. '_Resource' object has no attribute 'name'

xy-always commented 2 years ago

已经收到您的邮件。

jiandandema commented 2 years ago

谢谢您给马坤发送邮件,我会及时查看的,谢谢,辛苦了

jbrepogmailcom commented 2 years ago

Finally got it working

jbrepogmailcom commented 2 years ago

I have other question. Can you please advise how to use "Gradient Boosted Decision Tree (GBDT)" example? The description says that Rergression function can be used to estimate house price based on attributes. How to do it please?