Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

**Batch Prediction Error** #26

Open
iqram1337 opened this issue Jan 3, 2024 · 3 comments
Open

**Batch Prediction Error** #26

iqram1337 opened this issue Jan 3, 2024 · 3 comments

Comments

@iqram1337
Copy link

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

@iqram1337 iqram1337 changed the title **Batch Prediction Error* **Batch Prediction Error** Jan 3, 2024
@xioddd
Copy link

xioddd commented May 23, 2024

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

@ljh116
Copy link

ljh116 commented Dec 9, 2024

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

Hello,I tried the methods you suggested, but the issue still persists.Are there any other solutions?

@cookicelan
Copy link

cookicelan commented Jan 14, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants