yzhao062 / pyod

A Python Library for Outlier and Anomaly Detection, Integrating Classical and Deep Learning Techniques
http://pyod.readthedocs.io
BSD 2-Clause "Simplified" License
8.27k stars 1.35k forks source link

Problem with ALAD model training #570

Open FNikkhoo opened 1 month ago

FNikkhoo commented 1 month ago

Hello everyone,

I'm attempting to utilize the ALAD model for both training and inference on my custom dataset. However, I'm encountering an error that suggests certain portions of the main code in pyod/models/alad.py need modification. I'm including the code snippet I'm using for reference, along with the corresponding error message. Any assistance would be greatly appreciated. Additionally, I'm curious to know if anyone has successfully tested the ALAD model on a custom dataset.

My code Snippet: x_train_normal = np.load('x_train_normal.npy') from pyod.models.alad import ALAD ecod_model = ALAD()
ecod_model.fit(x_train_normal)

Error: lueError: 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).

yzhao062 commented 1 month ago

This is caused by keras update -- please use keras<3.0. we are trying to fully remove all tensorflow based implementation in the next few versions.

FNikkhoo commented 1 month ago

This is caused by keras update -- please use keras<3.0. we are trying to fully remove all tensorflow based implementation in the next few versions.

Thank you for your prompt response. I will try downgrading to keras<3.0 if it doesn’t cause additional conflicts. I appreciate your help and the update on future changes. Best regards,