AttributeError: 'numpy.ndarray' object has no attribute '_keras_mask' when calling

Full code example: #!/usr/bin/env python3import numpy as npimport tensorflow as tffrom tens -

The model takes three input tensors and produces two “one hot” output tensors. From python, I want to perform an inference on a model using random input data (yes, this sounds weird, but just go with it - the image data will NOT come from files on disk). The model that I want to use is actually more complex (5 inputs, 4 outputs), so i reduced it for the sake of this post.

When I call “”, I get a python exception AttributeError: 'numpy.ndarray' object has no attribute '_keras_mask'. I assume that I’m just not using the correct syntax to pass the numpy arrays into the “call()” method.

What changes need to be made to the code (in pastebin) so that the call to “call()” will succeed. Thank you for your time.

1 Like