из pytorch_transformers ModuleNotFoundError: нет модуля с именем 'utils'
Я сталкиваюсь с этой ошибкой при использовании pytorch_transformers в среде Colab после установки Anaconda и ее активации. Я нашел аналогичную проблему в https://github.com/huggingface/transformers/issues/1705, но у меня она не работает. Спасибо за вашу помощь!
!pip install transformers
!pip install simpletransformers
!pip install pytorch-transformers
import os
os.environ['PYTHONPATH'] = "/usr/local/bin/python"
import sys!source activate transformers!source activate transformers
sys.path.append('/usr/local/lib/python3.6/site-packages/')
!conda --version
!conda update -n base conda
!conda install -q -y --prefix /usr/local -c conda-forge tqdm
!conda create -n transformers tqdm
!source activate transformers
from __future__ import absolute_import, division, print_function
import glob
import logging
import os
import random
import json
import numpy as np
import torch
from torch.utils.data import (DataLoader, RandomSampler, SequentialSampler,
TensorDataset)
import random
from torch.utils.data.distributed import DistributedSampler
from tqdm import tqdm_notebook, trange
from pytorch_transformers import (WEIGHTS_NAME, BertConfig, BertForSequenceClassification, BertTokenizer,
XLMConfig, XLMForSequenceClassification, XLMTokenizer,
XLNetConfig, XLNetForSequenceClassification, XLNetTokenizer,
RobertaConfig, RobertaForSequenceClassification, RobertaTokenizer)
from pytorch_transformers import AdamW, WarmupLinearSchedule
from utils import (convert_examples_to_features,
output_modes, processors)
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
22 from pytorch_transformers import AdamW, WarmupLinearSchedule
23
---> 24 from utils import (convert_examples_to_features,
25 output_modes, processors)
26
ModuleNotFoundError: No module named 'utils'