-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
**if predictions.get_shape().ndims > 1: TypeError: '>' not supported between instances of 'NoneType' and 'int'** #3
Comments
以上是使用tf1.14存在的问题。tf1.13无experimental, tf1.12 cuda9目前无法使用。 |
This error is reported at the end when I run the first program file "train_main_plcp.py".
|
Hi, I haven't encountered the similar problems. Please modify the code according to tf version. |
|
@yy-mille To resolve this issue, you could choose a different version of tensorflow, but I could not find any version, that fits to the whole repository - other errors occured The best solution is to manually initialize the shape of the predictions by setting the predictions shape to the number of inputs and label number: |
Traceback (most recent call last):
File "ie/train_main_plcp.py", line 45, in
ot_clf_process(job_id, schema_set, train_data_path, train_para)
File "ie/train_main_plcp.py", line 29, in ot_clf_process
predicate_classification_model_train(job_id, schema_set, train_data_path, train_para)
File "/export1/scratch/qinjie/qinjie/Bert-MLC/LACO/LACO-main/ie/src/run_predicate_classification_plcp.py", line 1087, in predicate_classification_mode l_train
run_pred()
File "/export1/scratch/qinjie/qinjie/Bert-MLC/LACO/LACO-main/ie/src/run_predicate_classification_plcp.py", line 972, in run_pred
tf.estimator.train_and_evaluate(estimator, train_spec, eval_spec)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_a nd_evaluate
return executor.run()
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
return self.run_local()
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_loc al
saving_listeners=saving_listeners)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 367, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1158, in _trai n_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1192, in _trai n_model_default
saving_listeners)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1484, in _trai n_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 754, in run
run_metadata=run_metadata)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1252, in run
run_metadata=run_metadata)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1353, in run
raise six.reraise(*original_exc_info)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/six.py", line 719, in reraise
raise value
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1338, in run
return self._sess.run(*args, **kwargs)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 1419, in run
run_metadata=run_metadata))
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/basic_session_run_hooks.py", line 594, in aft er_run
if self._save(run_context.session, global_step):
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/training/basic_session_run_hooks.py", line 619, in _sa ve
if l.after_save(session, step):
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 519, in after_s ave
self._evaluate(global_step_value) # updates self.eval_result
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 539, in _evalua te
self._evaluator.evaluate_and_export())
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/training.py", line 920, in evaluat e_and_export
hooks=self._eval_spec.hooks)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 477, in evalua te
name=name)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 519, in _actua l_eval
return _evaluate()
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 501, in _evalu ate
self._evaluate_build_graph(input_fn, hooks, checkpoint_path))
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1501, in _eval uate_build_graph
self._call_model_fn_eval(input_fn, self.config))
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1537, in _call _model_fn_eval
features, labels, ModeKeys.EVAL, config)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1146, in _call _model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "/export1/scratch/qinjie/qinjie/Bert-MLC/LACO/LACO-main/ie/src/run_predicate_classification_plcp.py", line 835, in model_fn
File "/export1/scratch/qinjie/qinjie/Bert-MLC/LACO/LACO-main/ie/src/run_predicate_classification_plcp.py", line 811, in metric_fn
pos_indices_list, average="micro")
File "/export1/scratch/qinjie/qinjie/Bert-MLC/LACO/LACO-main/ie/src/bert/tf_metrics.py", line 42, in precision
labels, predictions, num_classes, weights)
File "/export/scratch/qinjie/miniconda3/envs/py36/lib/python3.6/site-packages/tensorflow/python/ops/metrics_impl.py", line 265, in _streaming_confusio n_matrix
TypeError: '>' not supported between instances of 'NoneType' and 'int'**
The text was updated successfully, but these errors were encountered: