AICoE / prometheus-anomaly-detector

A newer more updated version of the prometheus anomaly detector (https://github.com/AICoE/prometheus-anomaly-detector-legacy)
GNU General Public License v3.0
597 stars 151 forks source link

ValueError: Failed to convert a NumPy array to a Tensor (Unsupported object type float). #129

Closed tarakdatanow closed 3 years ago

tarakdatanow commented 4 years ago

Hi,

I'm facing this issue while using model_lstm. I've changed the "FLT_ROLLING_TRAINING_WINDOW_SIZE" to 10 days as per the script and metrics_list has two inputs.

What changes am I missing to make, any suggestions are welcome.

config.py:

# How often should the anomaly detector retrain the model (in minutes)
    retraining_interval_minutes = int(
        os.getenv("FLT_RETRAINING_INTERVAL_MINUTES", "2")
    )
    metric_chunk_size = parse_timedelta("now", str(retraining_interval_minutes) + "m")

    _LOGGER.info(
        "Metric data rolling training window size: %s", rolling_training_window_size
    )
    _LOGGER.info("Model retraining interval: %s minutes", retraining_interval_minutes)
4n4nd commented 4 years ago

thanks for letting us know, I will check it out :+1:

4n4nd commented 4 years ago

@tarakdatanow I have updated some things in the tensorflow model (model_lstm), this should be fixed now. Could you please try again with the latest commits?

tarakdatanow commented 4 years ago

Same error @4n4nd

2020-10-12 13:00:26,204:INFO:configuration: Metric data rolling training window size: 9 days, 23:59:59.880695 2020-10-12 13:00:26,205:INFO:configuration: Model retraining interval: 10 minutes Using TensorFlow backend. 2020-10-12 13:00:37.458232: W tensorflow/stream_executor/platform/default/dso_loader.cc:59] Could not load dynamic library 'libcudart.so.10.1'; dlerror: libcudart.so.10.1: cannot open shared object file: No such file or directory 2020-10-12 13:00:37.458310: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Traceback (most recent call last): File "/home/tarak/Desktop/prometheus-anomaly-detector/app_lstm.py", line 160, in <module> train_model(initial_run=True, data_queue=predicted_model_queue) File "/home/tarak/Desktop/prometheus-anomaly-detector/app_lstm.py", line 142, in train_model predictor_model.train( File "/home/tarak/Desktop/prometheus-anomaly-detector/model_lstm.py", line 81, in train model = self.get_model(lstm_cell_count_, dense_cell_count_) File "/home/tarak/Desktop/prometheus-anomaly-detector/model_lstm.py", line 55, in get_model model.add(LSTM(64, return_sequences=True, input_shape=(1, self.number_of_features))) File "/usr/local/lib/python3.8/dist-packages/keras/engine/sequential.py", line 166, in add layer(x) File "/usr/local/lib/python3.8/dist-packages/keras/layers/recurrent.py", line 541, in __call__ return super(RNN, self).__call__(inputs, **kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/keras/engine/base_layer.py", line 446, in __call__ self.assert_input_compatibility(inputs) File "/usr/local/lib/python3.8/dist-packages/keras/engine/base_layer.py", line 310, in assert_input_compatibility K.is_keras_tensor(x) File "/usr/local/lib/python3.8/dist-packages/keras/backend/tensorflow_backend.py", line 695, in is_keras_tensor if not is_tensor(x): File "/usr/local/lib/python3.8/dist-packages/keras/backend/tensorflow_backend.py", line 703, in is_tensor return isinstance(x, tf_ops._TensorLike) or tf_ops.is_dense_tensor_like(x) AttributeError: module 'tensorflow.python.framework.ops' has no attribute '_TensorLike'

4n4nd commented 4 years ago

@tarakdatanow could you please make sure that all the dependencies were updated according to the latest pipfile?

4n4nd commented 4 years ago

Could you run pip freeze in your environment and post the output here? Thanks

tarakdatanow commented 4 years ago

Got it @4n4nd it was the Tensorflow version I was using. Now I'm able to train it.

4n4nd commented 4 years ago

@tarakdatanow do you mind closing this issue then? thanks!

sesheta commented 3 years ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

/lifecycle stale

sesheta commented 3 years ago

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle rotten

sesheta commented 3 years ago

Rotten issues close after 30d of inactivity. Reopen the issue with /reopen. Mark the issue as fresh with /remove-lifecycle rotten.

/close

sesheta commented 3 years ago

@sesheta: Closing this issue.

In response to [this](https://github.com/AICoE/prometheus-anomaly-detector/issues/129#issuecomment-967789785): >Rotten issues close after 30d of inactivity. >Reopen the issue with `/reopen`. >Mark the issue as fresh with `/remove-lifecycle rotten`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.