smousavi05 / EQTransformer

EQTransformer, a python package for earthquake signal detection and phase picking using AI.
https://rebrand.ly/EQT-documentations
MIT License
311 stars 150 forks source link

Problem in Seisbench data format #141

Closed Andry92 closed 2 years ago

Andry92 commented 2 years ago

Dear @smousavi05,

I tried to create the dataset using Seisbench framework from KNMI client. I followed this tutorial to create it: https://colab.research.google.com/github/seisbench/seisbench/blob/main/examples/03b_creating_a_dataset.ipynb

I'm trying to train a new model using trainer function in this way:

trainer(input_hdf5='test_dataset_knmi_seisbench/waveforms.hdf5', input_csv='test_dataset_knmi_seisbench/metadata.csv', output_name='test_trainer_knmi', cnn_blocks=2, lstm_blocks=1, padding='same', activation='relu', drop_rate=0.2, label_type='gaussian', add_event_r=0.6, add_gap_r=0.2, shift_event_r=0.9, add_noise_r=0.5, mode='generator', train_valid_test_split=[0.60, 0.20, 0.20], batch_size=20, epochs=4, patience=2, gpuid=None, gpu_limit=None)

but it gets me this error:

_File "/home/andrea/anaconda3/envs/eqt/lib/python3.7/site-packages/h5py/_hl/attrs.py", line 56, in getitem attr = h5a.open(self._id, self._e(name)) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5a.pyx", line 80, in h5py.h5a.open KeyError: "Can't open attribute (can't locate attribute: 'tracecategory')"

Therefore in our hdf5 file the required attributes are missing but they are present in metadata (csv file). How can I resolve this dataset issue? Maybe I need to find another way to generate the dataset?

Thank you in advance

smousavi05 commented 2 years ago

@Andry92 I'm not involved in Seisbench development and as far as I know, they have their own version of EqT. How about QuakeLabeler @maihao14 have you tried it? I recommend getting in touch with Hao Mai (hmai090@uottawa.ca) the developer of QuaakeLabeler. He also has another easy-to-use framework (BluckyEQTransformer) for retraining the models.

Andry92 commented 2 years ago

Dear @smousavi05 I apologize if I'm responding late. Finally, I adapted the data generated from seisbench framework to start the training with your EQtransformer. So, seisbench library wasn't ready to generate data for EQtransformer. I had already tried with QuakeLabeler but it doesn't work.

I close this issue because now the problem is solved. Thank you