How to solve the problem No module named 'torch._C'?

Traceback (most recent call last):
File "/home/pi/Downloads/****/main.py", line 9, in
from run import process
File "/home/pi/Downloads/****/run.py", line 4, in
import DataLoader from gan, DeepModel, tensor2im
File "/home/pi/Downloads/****/gan.py", line 4, in
import torchvision.transforms as transforms
File "/home/pi/.local/lib/python3.7/site-packages/torchvision/__init__.py", line 1, in
from torchvision import models
File "/home/pi/.local/lib/python3.7/site-packages/torchvision/models/__init__.py", line 1, in
from .alexnet import *
File "/home/pi/.local/lib/python3.7/site-packages/torchvision/models/alexnet.py", line 1, in
import torch.nn as nn
File "/home/pi/.local/lib/python3.7/site-packages/torch/__init__.py", line 81, in
from torch._C import *
ModuleNotFoundError: No module named 'torch._C'

Help solve the problem
April 4th 20 at 00:42
1 answer
April 4th 20 at 00:44
Solution
It was easier, if I may say so. Helped reinstall torch. The use RPi4, here is a link to the user manual https://sites.google.com/view/steam-for-vision/ras...

Find more questions by tags Python