Python ModuleNotFoundError:没有名为';建模&x27;

Python ModuleNotFoundError:没有名为';建模&x27;,python,Python,我对深度学习和python非常陌生,我正在尝试重新创建这个项目 正如我看到的,在项目中有一个名为Bert_QuestionAnswer的文件。ipynb和data.txt是我看到的与原始Bert存储库的唯一区别,我只是将其加载到我的谷歌硬盘中,并将其作为笔记本打开,以查看它的使用情况。 当我运行第一部分时,我得到了ModuleNotFoundError:No module name'modeling'error。 它是哪个图书馆的一部分? 对索莫博迪来说,这就是问题所在: 看起来它试图从gith

我对深度学习和python非常陌生,我正在尝试重新创建这个项目

正如我看到的,在项目中有一个名为
Bert_QuestionAnswer的文件。ipynb
data.txt
是我看到的与原始Bert存储库的唯一区别,我只是将其加载到我的谷歌硬盘中,并将其作为笔记本打开,以查看它的使用情况。 当我运行第一部分时,我得到了
ModuleNotFoundError:No module name'modeling'
error。 它是哪个图书馆的一部分? 对索莫博迪来说,这就是问题所在:

看起来它试图从github repo源导入,而不是 而不是pip包

如果您在包含github的目录中运行此命令 回购,尝试在其他地方运行它

一如既往,非常感谢你的帮助。 这是引发错误的文件的代码:

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from IPython.core.debugger import set_trace
import collections
import json
import math
import os
import random
import modeling
import optimization
import tokenization
import six
import os
import tensorflow as tf


import logging
logging.getLogger('tensorflow').disabled = True
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import warnings
warnings.filterwarnings("ignore")





import time
from pandas import Series
from nltk.tokenize import sent_tokenize
import gensim.downloader as api
from gensim.parsing.preprocessing import remove_stopwords
word_vectors = api.load("glove-wiki-gigaword-100")  # load pre-trained word-vectors from gensim-data

您需要告诉python此模块的位置:

import sys
sys.path.append("/path/to/your/bert/repo")

因为python将在他的系统文件夹和当前工作目录中进行搜索。如果不在repo中运行它,python将找不到此模块。

如何将其链接到repo?我想我对这一切都太陌生了。。