hls4ml icon indicating copy to clipboard operation
hls4ml copied to clipboard

Fowarding datatype for one-dimensional profiling

Open JochiSt opened this issue 3 years ago • 0 comments

When I wanted to use the profiling toolchain from the latest GIT version, I get the following error:

Traceback (most recent call last):
  File "profiling.py", line 31, in <module>
    profiling_hlsmodel(model)
  File "profiling.py", line 22, in profiling_hlsmodel
    wp, wph, ap, aph = hls4ml.model.profiling.numerical(
  File "/home/jochen/GitHub/hls4ml/hls4ml/model/profiling.py", line 518, in numerical
    data = activations_hlsmodel(hls_model, X, fmt='summary', plot=plot)
  File "/home/jochen/GitHub/hls4ml/hls4ml/model/profiling.py", line 268, in activations_hlsmodel
    _, trace = model.trace(np.ascontiguousarray(X))
  File "/home/jochen/GitHub/hls4ml/hls4ml/model/graph.py", line 717, in trace
    top_function( x[i], predictions, ctypes.byref(ctypes.c_ushort()), ctypes.byref(ctypes.c_ushort()))
ctypes.ArgumentError: argument 1: <class 'TypeError'>: argument must be an ndarray

My test data is a one-dimensional np.array. The input to my network is a single number. I was able to fix this in #549

Versions used for this evaluation:

Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0]
Numpy 1.22.3
TensorFlow 2.8.0
Keras 2.8.0
HLS4ML 0.5.1

JochiSt avatar May 13 '22 09:05 JochiSt