Skip to content

Zero Size Error Reduction Operation #18

@rajabose

Description

@rajabose

I am getting the following error while running the training file.

2020-03-16 22:42:48.232059: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2020-03-16 22:42:48.255069: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7f8cebe02f00 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-03-16 22:42:48.255094: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
Traceback (most recent call last):
  File "dl_based_parser_train.py", line 30, in <module>
    main()
  File "dl_based_parser_train.py", line 26, in main
    random_state=random_state)
  File "../keras_en_parser_and_analyzer/library/dl_based_parser.py", line 42, in fit
    random_state=random_state)
  File "../keras_en_parser_and_analyzer/library/dl_based_parser.py", line 66, in fit_line_label
    random_state=random_state)
  File "../keras_en_parser_and_analyzer/library/classifiers/lstm.py", line 360, in fit
    Y = np_utils.to_categorical(ys, len(self.labels))
  File "/Users/rajabose/.pyenv/versions/keras-parser/lib/python3.7/site-packages/keras/utils/np_utils.py", line 49, in to_categorical
    num_classes = np.max(y) + 1
  File "<__array_function__ internals>", line 6, in amax
  File "/Users/rajabose/.pyenv/versions/keras-parser/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 2668, in amax
    keepdims=keepdims, initial=initial, where=where)
  File "/Users/rajabose/.pyenv/versions/keras-parser/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 90, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions