khundman / telemanom

A framework for using LSTMs to detect anomalies in multivariate time series data. Includes spacecraft anomaly data and experiments from the Mars Science Laboratory and SMAP missions.
https://arxiv.org/abs/1802.04431
Other
1.02k stars 246 forks source link

Error during operation #69

Open huliqujing opened 2 years ago

huliqujing commented 2 years ago

Hello Kyle,

I have a question for you, an error pops up when I run python example.py -l labeled_anomalies.csv. The error occurred after a certain epoch. I executed the code twice and got the error after the 16th and 20th epochs. The error content is as follows:

Epoch 19/35
2096/2096 [==============================] - 22s 11ms/step - loss: 0.0106 - val_loss: 1.6608e-04
Epoch 20/35
2096/2096 [==============================] - 21s 10ms/step - loss: 0.0101 - val_loss: 2.0771e-04
normalized prediction error: 0.01
Traceback (most recent call last):
  File "example.py", line 10, in <module>
    detector.run()
  File "E:\Zotero\Paper\storage\37LDVKWR\telemanom\telemanom\detector.py", line 210, in run
    errors.process_batches(channel)
  File "E:\Zotero\Paper\storage\37LDVKWR\telemanom\telemanom\errors.py", line 141, in process_batches
    window.prune_anoms()
  File "E:\Zotero\Paper\storage\37LDVKWR\telemanom\telemanom\errors.py", line 418, in prune_anoms
    E_seq = np.delete(E_seq, i_to_remove, axis=0)
  File "<__array_function__ internals>", line 6, in delete
  File "D:\Anaconda3\envs\tf2\lib\site-packages\numpy\lib\function_base.py", line 4406, in delete
    keep[obj,] = False
IndexError: arrays used as indices must be of integer (or boolean) type

Thank you very much and hope to hear from you soon.

ly1112 commented 1 year ago

Hello Kyle,

I have a question for you, an error pops up when I run python example.py -l labeled_anomalies.csv. The error occurred after a certain epoch. I executed the code twice and got the error after the 16th and 20th epochs. The error content is as follows:

Epoch 19/35
2096/2096 [==============================] - 22s 11ms/step - loss: 0.0106 - val_loss: 1.6608e-04
Epoch 20/35
2096/2096 [==============================] - 21s 10ms/step - loss: 0.0101 - val_loss: 2.0771e-04
normalized prediction error: 0.01
Traceback (most recent call last):
  File "example.py", line 10, in <module>
    detector.run()
  File "E:\Zotero\Paper\storage\37LDVKWR\telemanom\telemanom\detector.py", line 210, in run
    errors.process_batches(channel)
  File "E:\Zotero\Paper\storage\37LDVKWR\telemanom\telemanom\errors.py", line 141, in process_batches
    window.prune_anoms()
  File "E:\Zotero\Paper\storage\37LDVKWR\telemanom\telemanom\errors.py", line 418, in prune_anoms
    E_seq = np.delete(E_seq, i_to_remove, axis=0)
  File "<__array_function__ internals>", line 6, in delete
  File "D:\Anaconda3\envs\tf2\lib\site-packages\numpy\lib\function_base.py", line 4406, in delete
    keep[obj,] = False
IndexError: arrays used as indices must be of integer (or boolean) type

Thank you very much and hope to hear from you soon.

Hi, I have the same issue as you. Did you find a way to solve it and can you share your solution? Thank you so much!

gujingit commented 1 year ago

change code E_seq = np.delete(E_seq, i_to_remove, axis=0) to E_seq = np.delete(E_seq, i_to_remove.astype(np.int), axis=0) in telemanom/errors.py