Skip to content

make_predictions TypeError on preprocessed data #10

@clsteel

Description

@clsteel

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions