I'm getting a segfault in python during imports. This code:
import os
import matplotlib.pyplot as plt
import numpy as np
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
print("was there")
from torchvision import transforms
print("didn't get there")
from torchvision import datasets
from torchvision import models
returns this:
$ python3 -u classifier.py
was there
Erreur de segmentation (core dumped)
So torchvision.transforms seems to be responsible. I've tried switching the lines, and torchvision.models fails too.
I've also tried importing torchvision.transforms on it's own and there were no problems. What could possibly cause this?
Edit:
I'm working on Ubuntu 20.04.4 and installed torchvision through pip.