You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When passing data to insert_image, the returned type of the array is not the same as the original data passed. This can occasionally cause issues with data types when using the returned value. This is probably a minor issue and I can bypass this issue by simply converting the returned data back to the original dtype, but it might be nice to not require this step.
To Reproduce
In my case, I had a PyTorch model trained using input data with dtype=float32. The pytorch model weights appeared to be float tensors.
Steps:
I feed the input data of dtype=float32 to insert_image and receive a numpy array with dtype=float64
I convert the returned value into a PyTorch Tensor using torch.from_numpy(). This converts the returned value into a DoubleTensor
An error occurs when I use the converted tensor as input to art.estimator.get_activations(). The error is RuntimeError: Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same
I get similar issues if I pass an Int. I will get a float back.
Expected behavior
The dtype of the input to insert_image should be preserved.
System information (please complete the following information):
Unbuntu 18.04
Python 3.8
ART 1.9
The text was updated successfully, but these errors were encountered:
Describe the bug
When passing data to
insert_image
, the returned type of the array is not the same as the original data passed. This can occasionally cause issues with data types when using the returned value. This is probably a minor issue and I can bypass this issue by simply converting the returned data back to the original dtype, but it might be nice to not require this step.To Reproduce
In my case, I had a PyTorch model trained using input data with dtype=float32. The pytorch model weights appeared to be float tensors.
Steps:
insert_image
and receive a numpy array with dtype=float64art.estimator.get_activations()
. The error isRuntimeError: Input type (torch.cuda.DoubleTensor) and weight type (torch.cuda.FloatTensor) should be the same
I get similar issues if I pass an Int. I will get a float back.
Expected behavior
The dtype of the input to
insert_image
should be preserved.System information (please complete the following information):
The text was updated successfully, but these errors were encountered: