Did you try to use the suggestion from the error message?
Once you fix the numpy() error, you would have to check the shape of the output, since imshow expects an image format, while your output activation would contain the additional batch dimension. In that case, you could visualize each output separately. Also, you have to make sure the channel dimension is valid for an image format (i.e. it has to be 1 or 3). If that’s not the case, you could visualize each channel separately again.