My Device: Mac m1 pro
Environment:
Streamlit==1.21.1
torch==1.11.0 (I tried 2.0.0 but it failed, someone suggest to downgrade but still doesn’t work)
torchvision==0.12.0
numpy==1.23.5
content_transform = transforms.Compose([
transforms.Resize([224, 224]),
transforms.ToTensor(),
transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5])
])
# img: PIL.Image
img = content_transform(img)
After utilizing pdb.set_trace
for debugging purposes, I determined that the segmentation fault was caused by the code located within transforms.ToTensor()
.
img = img.permute((2, 0, 1)).contiguous()
I am unable to identify the cause of the issue and would appreciate any assistance in resolving it.