ModuleNotFoundError:没有名为“建模”的模块

文森佐

我是深度学习和python的新手,我正尝试在https://github.com/Nagakiran1/Extending-Google-BERT-as-Question-and-Answering-model-and-Chatbot上重新创建该项目

正如我看到的那样,在项目中有一个名为的文件Bert_QuestionAnswer.ipynb,这data.txt是我与原始Bert存储库唯一的区别,我只是将其加载到Google驱动器中,然后将其作为笔记本打开以查看其使用情况。当我运行第一部分的面团时,我会ModuleNotFoundError: No module named 'modeling'犯错误。它属于哪个库?对于somoebody,这就是问题所在:

看起来它正在尝试从github repo源而不是pip包中导入。

如果您在包含BERT 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将在他的系统文件夹和当前工作目录中搜索。如果您没有在存储库中运行它,则python找不到此模块。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

ModuleNotFoundError:没有名为“ knox”的模块

ModuleNotFoundError:没有名为“项目”的模块

ModuleNotFoundError:没有名为“ camelcase”的模块

ModuleNotFoundError: 没有名为“model”的模块

ModuleNotFoundError: 没有名为“src”的模块

ModuleNotFoundError:没有名为“dbutils”的模块

ModuleNotFoundError:没有名为“ fastai”的模块

ModuleNotFoundError:没有名为“dmidecode”的模块

ModuleNotFoundError: 没有名为“tensorboard”的模块

ModuleNotFoundError:没有名为“ pynput”的模块

ModuleNotFoundError:没有名为“ jieba”的模块

ModuleNotFoundError:没有名为“ buildozer”的模块

ModuleNotFoundError:没有名为“模型”的模块

ModuleNotFoundError:没有名为“ matplotlib”的模块

ModuleNotFoundError: 没有名为“bootstrapform”的模块

ModuleNotFoundError:没有名为“ BaseHTTPServer”的模块

ModuleNotFoundError:没有名为“ Cython”的模块

ModuleNotFoundError:没有名为“ gin”的模块

没有名为“Skimage”的模块 ModuleNotFoundError

ModuleNotFoundError:没有名为“ mglearn”的模块

ModuleNotFoundError:没有名为“烧瓶”的模块

ModuleNotFoundError:没有名为“python”的模块

ModuleNotFoundError: 没有名为“aiohttp”的模块

ModuleNotFoundError:没有名为“ printSoln”的模块

ModuleNotFoundError:没有名为“ lxml”的模块

ModuleNotFoundError:没有名为“ ruamel”的模块

ModuleNotFoundError:没有名为“ jose”的模块

ModuleNotFoundError:没有名为“ Ipython”的模块

ModuleNotFoundError:没有名为“表单”的模块