You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I am studetn and am trying to run the code but haven't been able.
I migrated the code to T2 but still facing this issue and am not sure how to solve it, do you have any suggestion how I can fix this
Many thanks
My issue:
when I run the code I get this error :
File "/home/ubuntu/ComGA-master/run.py", line 107, in <module>
runner.erun(writer)
File "/home/ubuntu/ComGA-master/anomaly_detection.py", line 68, in erun
model = GCNModelAE(placeholders,num_features,num_nodes,adj,features_nonzero,2000,500,128,256,128,self.at)
File "/home/ubuntu/ComGA-master/model.py", line 64, in __init__
self.build()
File "/home/ubuntu/ComGA-master/model.py", line 35, in build
self._build()
File "/home/ubuntu/ComGA-master/model.py", line 67, in _build
self.hidden1 =Dense(input_dim=self.n_samples,
File "/home/ubuntu/ComGA-master/layers.py", line 70, in __call__
outputs = self._call(inputs)
File "/home/ubuntu/ComGA-master/layers.py", line 179, in _call
output = tf.matmul(x, self.vars['weights'])
File "/opt/conda/lib/python3.10/site-packages/tensorflow/python/ops/weak_tensor_ops.py", line 142, in wrapper
return op(*args, **kwargs)
File "/opt/conda/lib/python3.10/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/opt/conda/lib/python3.10/site-packages/keras/src/backend/common/keras_tensor.py", line 91, in __tf_tensor__
raise ValueError(
ValueError: A KerasTensor cannot be used as input to a TensorFlow function. A KerasTensor is a symbolic placeholder for a shape and dtype, used when constructing Keras Functional models or Keras Functions. You can only use it as input to a Keras layer or a Keras operation (from the namespaces `keras.layers` and `keras.operations`). You are likely doing something like:
x = Input(...)
...
tf_fn(x) # Invalid.
What you should do instead is wrap `tf_fn` in a layer:
class MyLayer(Layer):
def call(self, x):
return tf_fn(x)
x = MyLayer()(x)
The text was updated successfully, but these errors were encountered:
Hi there,
I am studetn and am trying to run the code but haven't been able.
I migrated the code to T2 but still facing this issue and am not sure how to solve it, do you have any suggestion how I can fix this
Many thanks
My issue:
when I run the code I get this error :
x = Input(...)
...
tf_fn(x) # Invalid.
class MyLayer(Layer):
def call(self, x):
return tf_fn(x)
x = MyLayer()(x)
The text was updated successfully, but these errors were encountered: