AI4EPS / DeepDenoiser

DeepDenoiser: Seismic Signal Denoising and Decomposition Using Deep Neural Networks
MIT License
186 stars 60 forks source link

**Batch Prediction Error** #26

Open iqram1337 opened 10 months ago

iqram1337 commented 10 months ago

i try to run batch prediction with command: "python deepdenoiser/predict.py --format=mseed --model_dir=model/190614-104802 --data_dir=test_data/ --data_list=test_data/testing.csv --sampling_rate=100 --plot_figure --save_signal --save_noise"

but getting an error:

Traceback (most recent call last):
  File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 136, in <module>
    main(args)
  File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 129, in main
    pred_fn(args, data_reader, log_dir=args.output_dir)
  File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 81, in pred_fn
    X_batch, fname_batch, t0_batch = sess.run(data_batch)
  File "D:\miniconda3\lib\site-packages\tensorflow\python\client\session.py", line 968, in run
    result = self._run(None, fetches, feed_dict, options_ptr,
  File "D:\miniconda3\lib\site-packages\tensorflow\python\client\session.py", line 1191, in _run
    results = self._do_run(handle, final_targets, final_fetches,
  File "D:\miniconda3\lib\site-packages\tensorflow\python\client\session.py", line 1371, in _do_run
    return self._do_call(_run_fn, feeds, fetches, targets, options,
  File "D:\miniconda3\lib\site-packages\tensorflow\python\client\session.py", line 1397, in _do_call
    raise type(e)(node_def, op, message)  # pylint: disable=no-value-for-parameter
tensorflow.python.framework.errors_impl.InvalidArgumentError: Graph execution error:

Detected at node 'Input_Batch/IteratorGetNext' defined at (most recent call last):
    File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 136, in <module>
      main(args)
    File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 129, in main
      pred_fn(args, data_reader, log_dir=args.output_dir)
    File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 56, in pred_fn
      data_batch = data_reader.dataset(args.batch_size)
    File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\data_reader.py", line 801, in dataset
      dataset = tf.compat.v1.data.make_one_shot_iterator(
Node: 'Input_Batch/IteratorGetNext'
Incompatible shapes at component 0: expected [?,3,1,31,1202,2] but got [1,3,1,31,1201,2].
         [[{{node Input_Batch/IteratorGetNext}}]]

Original stack trace for 'Input_Batch/IteratorGetNext':
  File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 136, in <module>
    main(args)
  File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 129, in main
    pred_fn(args, data_reader, log_dir=args.output_dir)
  File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\predict.py", line 56, in pred_fn
    data_batch = data_reader.dataset(args.batch_size)
  File "D:\QuakeFlow\DeepDenoiser\deepdenoiser\data_reader.py", line 801, in dataset
    dataset = tf.compat.v1.data.make_one_shot_iterator(
  File "D:\miniconda3\lib\site-packages\tensorflow\python\data\ops\iterator_ops.py", line 440, in get_next
    flat_ret = gen_dataset_ops.iterator_get_next(
  File "D:\miniconda3\lib\site-packages\tensorflow\python\ops\gen_dataset_ops.py", line 3036, in iterator_get_next
    _, _, _op, _outputs = _op_def_library._apply_op_helper(
  File "D:\miniconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 797, in _apply_op_helper
    op = g._create_op_internal(op_type_name, inputs, dtypes=None,
  File "D:\miniconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3800, in _create_op_internal
    ret = Operation(

this is my input data: Screenshot 2024-01-03 070032

xioddd commented 6 months ago

The reason might be found in these two lines of code: if np.mod(data.shape[-1], 3000) == 1: # 3001=>3000 and data = data[..., :-1] (←in data_reader.py). Commenting them out should allow the program to run successfully.Please forgive my poor English QAQ