Skip to content

make_predictions TypeError on preprocessed data #10

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

Open
clsteel opened this issue Mar 19, 2025 · 0 comments
Open

make_predictions TypeError on preprocessed data #10

clsteel opened this issue Mar 19, 2025 · 0 comments

Comments

@clsteel
Copy link

clsteel commented Mar 19, 2025

I successfully pre-processed all my data and have the directories of h5 files, but when attempting to run the make_predictions.py script it partially processes one file and then throws this error:

Traceback (most recent call last):
  File "/.conda/envs/deep_postures_pytorch/lib/python3.11/site-packages/numpy/lib/_shape_base_impl.py", line 872, in split
    len(indices_or_sections)
TypeError: object of type 'int' has no len()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "DeepPostures/MSSE-2021/make_predictions.py", line 323, in <module>
    generate_predictions(args.pre_processed_dir, output_dir=args.predictions_dir, model=args.model, segment=not args.no_segment, output_label=args.output_label,
  File "DeepPostures/MSSE-2021/make_predictions.py", line 141, in generate_predictions
    reshaped_subject_data = np.split(subject_data, subject_data.shape[0]//bi_lstm_win_size)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".conda/envs/deep_postures_pytorch/lib/python3.11/site-packages/numpy/lib/_shape_base_impl.py", line 876, in split
    if N % sections:
       ~~^~~~~~~~~~
ZeroDivisionError: integer modulo by zero

I don't know fully how to interact with the h5 files to try to troubleshoot this. Thanks very much for any assistance!

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

1 participant