danielenricocahall / One-Class-NeuralNetwork

Simplified implementation of one class neural network for nonlinear anomaly detection.
MIT License
46 stars 4 forks source link

I meet the following errors when running driver.py #6

Open yangqbo opened 2 years ago

yangqbo commented 2 years ago

Dear Mr.Danial, Thanks for sharing your code.

I meet the following errors when running driver.py:

Error detected in node 'custom_hinge/percentile/SelectV2' defined at: File "/home/yangqb/anaconda3/envs/ocnn/lib/python3.8/site-packages/tensorflow_probability/python/stats/quantiles.py", line 631, in percentile

TypeError: tf.Graph captured an external symbolic tensor. The symbolic tensor 'custom_hinge/percentile/SelectV2:0' created by node 'custom_hinge/percentile/SelectV2' is captured by the tf.Graph being executed as an input. But a tf.Graph is not allowed to take symbolic tensors from another graph as its inputs. Make sure all captured inputs of the executing tf.Graph are not symbolic tensors. Use return values, explicit Python locals or TensorFlow collections to access it. Please see https://www.tensorflow.org/guide/function#all_outputs_of_a_tffunction_must_be_return_values for more information.

danielenricocahall commented 2 years ago

Hello! What version of Tensorflow are you using?

yangqbo commented 2 years ago

Hello, the version of my Tensorflow is 2.7.0, is it too new??

danielenricocahall commented 2 years ago

Ah it might be - I should pin the version. I think the last one I've tested with was 2.4.

danielenricocahall commented 2 years ago

It looks like up through 2.5 works. I've pinned the deps, and I also needed to add run_eagerly to the compile call.