Hello
l have 4-D tensor variable (1,1,2040,1) that l want to covert to a numpy 1-D vector of dim(2040)
l tried
Variable(image).numpy()
but it gives me a 4-d numpy array (1,1,2040,1)
Thank you
Hello
l have 4-D tensor variable (1,1,2040,1) that l want to covert to a numpy 1-D vector of dim(2040)
l tried
Variable(image).numpy()
but it gives me a 4-d numpy array (1,1,2040,1)
Thank you
I suppose image is your Tensor
?
Try:
image = image.numpy().ravel()
Try image.squeeze().numpy()
, if the image
is a tensor