UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xc6 in position 680: invalid continuation byte

An error is reported when debugging the train file.
The location of the error appears in another file:
insert image description here
Most of the comments on the Internet are coding errors, and an error is reported when reading the csv, but I did not read the csv file at all, and the error was reported on the first line of the train file. First rule out whether Chinese appears in the code. plus:

# -*- coding: utf-8 -*-

Then I still reported an error, and finally found a solution, CUDA is not initialized, add at the beginning of the train file:

import torch
torch.cuda._initialized = True

Guess you like

Origin blog.csdn.net/qq_43733107/article/details/132620693